I am deciding the parameters for a random forest classification model. I am using the caret package and read, here, about the tuning grid. My understanding is that it helps determine the best values for the tuning parameters, like mtry and n.trees.

Isn't that redundant to trControl? As I understand it, if I set trControl to trainControl(method = "repeatedcv", number = 10, repeats = 3), then it will re-run the model three times with ten-fold cross validation to find the best values for the tuning parameters.

If that's true, then what purpose does tunegrid serve?


1 Answer 1


By default, caret will estimate a tuning grid for each method. However, sometimes the defaults are not the most sensible given the nature of the data. The tuneGrid argument allows the user to specify a custom grid of tuning parameters as opposed to simply using what exists implicitly.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.