If cross validation is too costly to determine the number of trees and number of max_features is there any standard to what you choose based on n and p. I know sqrt(p) is standard for max_features but what about number of trees?
1 Answer
Two things to consider (generally speaking): Overfitting is not a concern Random Forests, and the most improvement will come in the first few hundred trees. If you just want to run it once and get a pretty good answer, I'd set n to 1500 or more and you should be in pretty good shape.
If you're implementing this in R, the foreach package makes it pretty easy to implement random forest in parallel, so if you have 4 or 8 cores you should be able to significantly decrease the training time of your model.
-
3$\begingroup$ Keep in mind that each tree is iid, so you can actually just train a large number of trees and then check whether the first 500 or the first 1000 are sufficiently precise. That is, you don't need to tune over ntree at the same time you tune mtry. $\endgroup$– Sycorax ♦Commented Aug 14, 2015 at 15:53