How to specify minbucket in caret train for?

。_饼干妹妹 提交于 2019-12-02 20:43:56

问题


For CART model, caret seems to only provide tunning of complexity parameter. Is there way to tune other parameters such as minbucket?


回答1:


Arguments passed to the classification or regression routines are included in the dots parameter.

As you want to include minbucket, parameter control should be included inside train.

As example:

library("caret")

train(Kyphosis ~ Age + Number + Start, data = kyphosis, 
      method = "rpart",
      tuneGrid = data.frame(cp = c(0.01, 0.05)),
      control = rpart.control(minsplit = 10, minbucket = 5))

If you want to tune minbucket you will have to do it manually.



来源:https://stackoverflow.com/questions/36781755/how-to-specify-minbucket-in-caret-train-for

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!