1
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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