[英]How to tune mtry and number of trees simultaneously for a Random Forest Regression?
I am trying to tune parameters for a Random Forest using caret
and method ranger
.我正在尝试使用caret
和方法ranger
调整随机森林的参数。 I have seen codes for tuning mtry
using tuneGrid
.我已经看到了使用tuneGrid
调整mtry
的代码。 And then using the resulted mtry
to run loops and tune the number of trees ( num.tree
).然后使用生成的mtry
运行循环并调整树的数量( num.tree
)。 However, I would like to know if it is possible to tune them both at the same time, to find out the best model between all possible combinations.但是,我想知道是否可以同时调整它们,以找出所有可能组合之间的最佳模型。 I do not want to keep one argument constant and tune the other one, but both at the same time.我不想让一个论点保持不变并调整另一个论点,但要同时调整两者。 Is there any way?有什么办法吗?
You cannot tune ntree
as part of a tuneGrid
for Random Forest in caret
;您不能在caret
中将ntree
作为随机森林的tuneGrid
的一部分进行调整; only mtry
, splitrule
and min.node.size
- see the tuning parameters for each model type here: https://topepo.github.io/caret/available-models.html只有mtry
、 splitrule
和min.node.size
- 在此处查看每种模型类型的调整参数: https ://topepo.github.io/caret/available-models.html
ntree
can only be specified in train
. ntree
只能在train
中指定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.