I am using lightgbm
to train LGBM models in R. However, whenever I call lgb.cv() function, lots of warning messages came out.
My code is written as:
train_params <- list(objective = "binary", learning_rate = 0.2, num_leaves = 50L,
bagging_fraction = 0.3,
bagging_freq = 10,
deterministic = T, force_row_wise = T)
dtrain <- lgb.Dataset(as.matrix(train_data[, vars]), label = as.numeric(train_data[, outcome]), categorical_feature = cat_vars)
lgbm_cv <- lgb.cv(params = train_params, data = dtrain, verbose = -1)
Running the code above gave me the messages like
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.446809 -> initscore=-0.213574
[LightGBM] [Info] Start training from score -0.213574
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.500000 -> initscore=0.000000
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.553191 -> initscore=0.213574
[LightGBM] [Info] Start training from score 0.213574
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements [LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
[LightGBM] [Warning] Stopped training because there are no more leaves that meet the split requirements
..... (and many more)
These have occupied my console. I saw some discussions mentioned to put -1 for verbose, but it didn't work in my code. Did I miss anything? Is there other way to suppress the warning messages?