0
$\begingroup$

From below code, I am getting optimal number of mtry. What is this mtry ? and How should I find the optimal number of tree that to be assigned to Random forest algorithm so that it will give High accuracy.

Any comment will be highly appreciated ! Thanks in Advance.

classifier = train(form = Survived ~ ., data = training_set_scaled, method = 'rf')
classifier
classifier$bestTune
$\endgroup$
2
$\begingroup$

mtry is the parameter indicating how many of the features are checked in each split decision. http://topepo.github.io/caret/train-models-by-tag.html#random-forest , see method 'rf'

In Random Forest, usually more trees give more stable results, and overfitting due to number of trees is rare. Moreover, since the trees are built independently, you could just fit many trees then take subsets to get smaller models. But, see e.g. hyperparameter tuning in mlr for how to perform grid, random, Bayesian, and other hyperparameter searches, or grid in caret or random in caret.

$\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.