1

The particular problem I try to solve require me to control the depth of trees in a random forest model. The most popular randomForest package does not allow users to precisely control the maximum depth. Are there any random forest implementations that control the max depth?

I am dealing with a large dataset, so speed is also a consideration.

Dr. Who
  • 153
  • 1
  • 14
  • If you aren't tied to a particular tree-based method then XgBoost is a gradient boosting implementation that allows control of the maximum depth. – Zach Nov 12 '16 at 01:01

1 Answers1

1

Random forest creates deep trees (its kind of its thing in comparison to XGBoost and others). So, why do you want to use random forest with a set depth? See this question for why setting maximum depth for random forest is a bad idea.

Also, as discussed in this SO question, node size can be used as a practical proxy to control the maximum depth that each tree grows to. That link also contains some comments about improving performance.

Community
  • 1
  • 1
vincentmajor
  • 1,076
  • 12
  • 20
  • The reason I want to limit depth is because I only want to look at the 2 way (or n-way) partition. The goal here is not more predictive power. – Dr. Who Nov 14 '16 at 20:25
  • Then you don't want random forest. Look into hierarchical clustering or recursive partitioning trees. – vincentmajor Nov 15 '16 at 04:55