Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with randomForest & long vectors

I am running random forest on a data set with 8 numeric columns (the predictors), and 1 factor (the outcome). There are 1.2M rows in the dataset. When I do:

randomForest(outcome.f ~ a + b + c + d + e + f + g + h,data=mdata)), I get an error:

"Error in randomForest.default(m, y, ...) : 
 long vectors (argument 26) are not supported in .Fortran"

Is there any way to prevent this? I don't understand why the package is (apparently) trying to allocate a vector of length 2^31-1. I'm using Mac OS X 10.9.2, with an Intel Core i7 (in case the architecture matters).

Session info

R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] randomForest_4.6-7

loaded via a namespace (and not attached):
[1] tools_3.1.0
like image 715
alex Avatar asked Jun 13 '14 00:06

alex


1 Answers

You can also reduce the number of trees (ntree).

like image 73
gcamargo Avatar answered Sep 24 '22 08:09

gcamargo