如何同时调整树木数量和树木数量以进行随机的森林回归?
我正在尝试使用caret
和方法Ranger
来调整随机森林的参数。我已经看到了使用Tunegrid
来调整mtry
的代码。然后使用结果mtry
运行循环并调整树的数量(num.tree
)。但是,我想知道是否可以同时调整它们,以找出所有可能组合之间的最佳模型。我不想保持一个论点不变并调整另一个论点,而是同时调整一个论点。有什么办法吗?
I am trying to tune parameters for a Random Forest using caret
and method ranger
. I have seen codes for tuning mtry
using tuneGrid
. And then using the resulted mtry
to run loops and tune the number of trees (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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为
tunegrid
的一部分,您无法调整ntree
;仅caret
; tunegridmtry
,splitrule
和min.node.size
- 请参阅每个型号类型的调谐参数:https://topepepo.github.io/caret/caret/caret/caret/caret/available-models.html.html
ntree
只能在Train
中指定。You cannot tune
ntree
as part of atuneGrid
for Random Forest incaret
; onlymtry
,splitrule
andmin.node.size
- see the tuning parameters for each model type here:https://topepo.github.io/caret/available-models.html
ntree
can only be specified intrain
.