简体   繁体   中英

Tree depth tuning with randomForest in R

I am working with the randomForest command in r , and I would like to tune the tree depth. However, there is no argument corresponding to tree depth for the randomForest package. From my understanding, I could tune max nodes instead, but I can't figure out how exactly the two relate to each other. Is the number of terminal nodes in each tree about two times the number of variables considered in each tree?

Also, is there a specific reason why randomForest does not allow to directly tune the tree depth? From what I know, it is the most important hyperparameter to be tuned when calibrating a random forest model..

To my understanding it's the parameter nodesize and maxnodes that relates to the tree depth.

From the package-documentation, nodesize ist defined as:

Minimum size of terminal nodes. Setting this number larger causes smaller trees to be grown (and thus take less time). Note that the default values are different for classification (1) and regression (5).

From the package-documentation, maxnodes ist defined as:

Maximum number of terminal nodes trees in the forest can have. If not given, trees are grown to the maximum possible (subject to limits by nodesize). If set larger than maximum possible, a warning is issued.

I don't know about this particular 'design choice'. From a hyper-parameter-tuning point of view they are just parameters that corresponds implicitly to the tree depth, and can be optimised accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM