I am performing cross-validation with xgboost in R. I have a Windows 10 system and am using 3.3.2. For some of my runs, a number of iterations are required before my early stop requirement has been met. So, I wish reduce the number of lines spit out in the console.
I have tried silent=1
which does nothing to silence the output in the console, verbose_eval=50
which does nothing to limit the output in the console and lastly verbose_eval=False
which gives the following error message and halts termination:
Error in check.deprecation(...) : object 'False' not found
I suppose the last one may only be valid in Python and that might be the source of the error. Still, the other two methods I try do not reduce the output to the console.
My code to show how I am applying these:
for (eta in seq(0,1,0.1)) {
param <- list(objective = "reg:linear", val_metric = "rmse", eta = eta, booster = "dart")
mdcv <- xgb.cv(param = param, data = sapply(train[1:80], as.numeric), label = as.numeric(unlist(train[81])), verbose_eval=50, nfold = 10, nrounds = 30000, early_stopping_rounds = 8)
min_rmse <- mdcv[[4]][mdcv$best_iteration]$test_rmse_mean
print(paste(eta, ' ', min_rmse))
}