1

I recently used "xgb.cv" estimate the accuracy of xgboost. I found that the element pred can get the prediction value. I also want to get the corresponding observation value(test data), or a matrix contain with prediction and observation value, however, there was not a useful element or argument to achieve. Did I miss some details? Or is there other ways?

My code:

cv <- xgb.cv(data = x_DMatrix,     
                 max_depth = 3,        
                 nrounds = 10,         
                 nfold = 10,                  
                 prediction = TRUE,           
                 metrics = "rmse",           
                 objective ="reg:linear")    

cv$evaluation_log      # list of evaluation metrics
cv$pred                # get the pretiction value

The argument of "xgb.cv":

feval: custimized evaluation function. Returns list(metric='metric-name', value='metric-value') with given prediction and dtrain.

The help documentation is not specified. What is the mean and usage of feval?

I am searching on net but no match answer. Please help or try to give some ideas how to achieve this. Thanks in advance.

Lee
  • 11
  • 1
  • https://stackoverflow.com/questions/40159415/what-is-difference-between-eval-metric-and-feval-in-xgboost can help you. – abhiieor Nov 19 '18 at 10:13

0 Answers0