# How to find optimal number of trees in random forest using Grid search in R?

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


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'