ics/xgb.DMatrix">xgb.DMatrix</a></span>(agaricus.train<span class="op">$</span>data,
                      <span class="dt">label =</span> agaricus.train<span class="op">$</span>label)
cv_folds &lt;-<span class="st"> </span><span class="kw">KFold</span>(agaricus.train<span class="op">$</span>label, <span class="dt">nfolds =</span> <span class="dv">5</span>,
                  <span class="dt">stratified =</span> <span class="ot">TRUE</span>, <span class="dt">seed =</span> <span class="dv">0</span>)
xgb_cv_ba