How to specify minbucket in caret train for?

2019-03-06 00:38发布

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

标签: r r-caret rpart
1条回答
Bombasti
2楼-- · 2019-03-06 00:51

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.

查看更多
登录 后发表回答