Re: [R] sampsize in Random Forests

2008-04-15 Thread Federico
... On 10 mar, 17:00, "Liaw, Andy" <[EMAIL PROTECTED]> wrote: > Are you sure there are 100 sites in your data? Here's an example: > > R> library(randomForest)randomForest4.5-23 > Type rfNews() to see new features/changes/bug fixes. > R> f <- factor(sample(1:4, nrow(iris), replace=TRUE)) > R> rf1

Re: [R] sampsize in Random Forests

2008-04-15 Thread Federico
Dear Naiara and Andy, My strategy in cases with unbalanced data is: tmp <- as.vector(table(factors)); num_clases <- length(tmp); min_size <- tmp[order(tmp,decreasing=FALSE)[1]]; vector_for_sampsize <- rep(min_size,num_clases); Then: randomForest(..., y=factors, sampsize=vector_for_sampsize) I h

Re: [R] sampsize in Random Forests

2008-03-10 Thread Liaw, Andy
Are you sure there are 100 sites in your data? Here's an example: R> library(randomForest) randomForest 4.5-23 Type rfNews() to see new features/changes/bug fixes. R> f <- factor(sample(1:4, nrow(iris), replace=TRUE)) R> rf1 <- randomForest(iris[1:4], iris[[5]], strata=f, sampsize=rep(5, nlevels(