title: xgboost in R: how does xgb.cv pass the optimal parameters into xgb.train
body: <p>I've been exploring the <code>xgboost</code> package in R and went through several demos as well as tutorials but this still confuses me: after using <code>xgb.cv</code> to do cross validation, how does the optimal parameters get passed to <code>xgb.train</code>? Or should I calculate the ideal parameters (such as <code>nround</code>, <code>max.depth</code>) based on the output of <code>xgb.cv</code>?</p>
  
  <pre><code>param &lt;- list("objective" = "multi:softprob",
                "eval_metric" = "mlogloss",
                "num_class" = 12)
  cv.nround &lt;- 11
  cv.nfold &lt;- 5
  mdcv &lt;-xgb.cv(data=dtrain,params = param,nthread=6,nfold = cv.nfold,nrounds = cv.nround,verbose = T)
  
  md &lt;-xgb.train(data=dtrain,params = param,nround = 80,watchlist = list(train=dtrain,test=dtest),nthread=6)
  </code></pre>