Print_every_n doesn't work

Im using an older version of the xgboost R package.
I’ve noticed however, that setting the print_every_n parameter in xgb.train with an integer has no effect. I checked the documentary, I even set verbose=1 explicitly, but this didn’t help either in letting the runs be printed.
Is this a bug? What am I missing?
I know a much newer version is out, but for certain reasons an update is not easily possible. If it was a bug and has been resolved, then I might look for workarounds to upgrade the package.


In the latest XGBoost (, the problem is fixed:

dtrain <- with(agaricus.train, xgb.DMatrix(data, label = label))
dtest <- with(agaricus.test, xgb.DMatrix(data, label = label))
watchlist <- list(train = dtrain, eval = dtest)
bst <- xgb.train(param, dtrain, nrounds = 10, watchlist = watchlist, verbose = 1,
                 print_every_n = 2)


[1]	train-auc:0.958228	eval-auc:0.960373 
[3]	train-auc:0.997070	eval-auc:0.998518 
[5]	train-auc:0.999298	eval-auc:0.999830 
[7]	train-auc:0.999585	eval-auc:1.000000 
[9]	train-auc:0.999916	eval-auc:1.000000 
[10]	train-auc:1.000000	eval-auc:1.000000 
1 Like

Thanks for your reply, I’ll try the newer version. I didn’t know it was a bug. Cheers