title: Hyper-parameter tuning using pure ranger package in R
body: <p>Love the speed of the ranger package for random forest model creation, but can't see how to tune mtry or number of trees. I realize I can do this via caret's train() syntax, but I prefer the speed increase that comes from using pure ranger.</p>
  
  <p>Here's my example of basic model creation using ranger (which works great):</p>
  
  <pre><code>library(ranger)
  data(iris)
  
  fit.rf = ranger(
    Species ~ .,
    training_data = iris,
    num.trees = 200
  )
  
  print(fit.rf)
  </code></pre>
  
  <p>Looking at the official documentation for tuning options, it seems like the csrf() function may provide the ability to tune hyper-parameters, but I can't get the syntax right:</p>
  
  <pre><code>library(ranger)
  data(iris)
  
  fit.rf.tune = csrf(
    Species ~ .,
    training_data = iris,
    params1 = list(num.trees = 25, mtry=4),
    params2 = list(num.trees = 50, mtry=4)
  )
  
  print(fit.rf.tune)
  </code></pre>
  
  <p>Results in: </p>
  
  <pre><code>Error in ranger(Species ~ ., training_data = iris, num.trees = 200) : 
    unused argument (training_data = iris)
  </code></pre>
  
  <p>And I'd prefer to tune with the regular (read: non-csrf) rf algorithm ranger provides. Any idea as to a hyper-parameter tuning solution for either path in ranger? Thank you!</p>