The grid should be a simple data frame with a column called .mtry
. The code
g = createGrid("cforest", len, data)
will generate that for you. If you want to specify ntree
you just pass a controls
object in as another argument to train
but leave out mtry
:
mod <- train(Species ~ ., data = iris,
method = "cforest",
controls = cforest_unbiased(ntree = 10))
caret
takes care of changing mtry
for you.
Max