0

I am trying to tune parameters for a Random Forest using caret and method ranger. I have seen codes for tuning mtry using tuneGrid. And then using the resulted mtry to run loops and tune the number of trees (num.tree). However, I would like to know if it is possible to tune them both at the same time, to find out the best model between all possible combinations. I do not want to keep one argument constant and tune the other one, but both at the same time. Is there any way?

SteveMcManaman
  • 391
  • 1
  • 17

1 Answers1

1

You cannot tune ntree as part of a tuneGrid for Random Forest in caret; only mtry, splitrule and min.node.size - see the tuning parameters for each model type here: https://topepo.github.io/caret/available-models.html

ntree can only be specified in train.

rw2
  • 1,549
  • 1
  • 11
  • 20