How to specify minbucket in caret train for?

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

Asked By: KTY
||

Answer #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.

Answered By: LluĂ­s Ramon
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .



# More Articles