How to specify minbucket in caret train for?

时间:2016-04-21 22:48:54

标签: r r-caret rpart

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

1 个答案:

答案 0 :(得分:3)

传递给分类或回归例程的参数包含在dots参数中。

如果要包含minbucketcontrol内应包含参数train

例如:

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))

如果你想调整minbucket,你必须手动完成。