yes &lt;-<span class="st"> </span><span class="cf">function</span>(max_depth, min_child_weight, subsample) {
  cv &lt;-<span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/xgboost/topics/xgb.cv">xgb.cv</a></span>(<span class="dt">params =</span> <span class="kw">list</span>(<span class="dt">booster =</span> <span class="st">"gbtree"</span>, <span class="dt">eta =</span> <span class="fl">0.01</span>,
                             <span class="dt">max_depth =</span> max_dep