title: accessing watchlist history in xgboost r package
body: <p>I'm using the xgboost R package to perform a multi-class classification task.
  This is a piece of code I create to illustrate the problem(input and output are randomly generated so results of course makes no sense, it's something I've done just to play around and learn how to handle the package):</p>
  
  <pre><code>require(xgboost)
  # First of all I set some parameters
  featureNumber = 5
  num_class = 4
  obs = 1000
  
  # I declare  a function that I will use to generate my categorical labels
  generateLabels &lt;- function(x,num_class){
    label &lt;- 0
    if(runif(1,min=0,max =1) &lt;0.1){
        label &lt;- 0
    }else{
        label &lt;- which.max(x) -1
        foo &lt;- runif(1,min=0,max =1)
        if(foo &gt; 0.9){label &lt;- label + 1}
        if(foo &lt; 0.1){label &lt;- label - 1}
    }
    return(max(min(label,num_class-1),0))
  }
  
  # I generate a random train set and his labels
  features &lt;- matrix(runif(featureNumber*obs, 1, 10), ncol = featureNumber)
  labels &lt;- apply(features, 1, generateLabels,num_class = num_class) 
  dTrain &lt;- xgb.DMatrix(data = features, label = labels)
  
  # I generate a random test set and his labels
  testObs = floor(obs*0.25)
  featuresTest &lt;- matrix(runif(featureNumber*testObs, 1, 10), ncol = featureNumber)
  labelsTest &lt;- apply(featuresTest, 1, generateLabels, num_class = num_class) 
  dTest &lt;- xgb.DMatrix(data = featuresTest, label = labelsTest)
  
  # I train the 
  xgbm   &lt;- xgb.train(data = dTrain, 
                    nrounds = 10,
                    objective = "multi:softprob", 
                    eval_metric = "mlogloss", 
                    watchlist = list(train=dTrain, eval=dTest),                          
                    num_class = featureNumber)
  </code></pre>
  
  <p>This works as expected and produces the expected results, here's a few lines:</p>
  
  <pre><code>[0] train-mlogloss:1.221495 eval-mlogloss:1.292785
  [1] train-mlogloss:0.999905 eval-mlogloss:1.121077
  [2] train-mlogloss:0.846809 eval-mlogloss:1.014519
  [3] train-mlogloss:0.735182 eval-mlogloss:0.942461
  [4] train-mlogloss:0.650207 eval-mlogloss:0.891341
  [5] train-mlogloss:0.580136 eval-mlogloss:0.851774
  [6] train-mlogloss:0.524390 eval-mlogloss:0.827973
  [7] train-mlogloss:0.475884 eval-mlogloss:0.815081
  [8] train-mlogloss:0.435342 eval-mlogloss:0.799799
  [9] train-mlogloss:0.402307 eval-mlogloss:0.789209
  </code></pre>
  
  <p>What I cannot achieve is to store those values to use them later. Is it possible to do this? It would be very helpful to tune the parameters.</p>
  
  <p>P.S. I know I could use the xgb.cv, the cross-validation method included in the package, to obtain similar results; but I'd rather use this method to have more control over what happens, also, since those metrics are calculated, it seems to me a waste of computational power not having the possibility to use them apart from reading it on-screen.</p>