<p>You can look into these two papers, which try to answer your questions:</p>

<p><a href="http://jmlr.org/papers/v18/17-269.html" rel="nofollow noreferrer">http://jmlr.org/papers/v18/17-269.html</a></p>

<p><a href="https://arxiv.org/abs/1804.03515" rel="nofollow noreferrer">https://arxiv.org/abs/1804.03515</a></p>

<p>tuneRanger is a package especially for tuning random forest in R. </p>
Hyperparameter tuning using MLR package
<p>I want to tune hyperparameters for random forest using the MLR package. I have a few questions:</p>

<p>1) How do I decide which of the parameters I should tune? I heard something about keeping num.trees as high as computationally possible and tuning mtry? (I couldn't find anything online backing this up though)</p>

<p>2) What should be my range of tuning mtry? Is here a good rule of thumb between 0 and 1/3 of the parameter? If so, how would I integrate that in the code below if I have different data sets (i.e., what would I write instead of lower=0 and upper =10)?</p>

<p>3) Lastly, does it even make sense to create the learner twice, once with makeLearner function where I set the parameter in par.vals and then once with makeTuneWrapper function? Doesn’t it overwrite it then anyways?</p>

<pre><code>learnerRF = makeLearner("regr.ranger", par.vals = list("num.trees" = 5000)) 
parsRF = makeParamSet(
  makeIntegerParam("mtry", lower = 0 , upper = 10), 
)
tuneRF = makeTuneControlGrid() 
inner = makeResampleDesc("CV", iters = 10)
learnerRF = makeTuneWrapper(learnerRF, resampling = inner, par.set = parsRF,control = tuneRF, show.info = FALSE) 
</code></pre>