What is the lightGBM no further splits warning?


When running lightgbm model, you might see this warning:
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf

So what is this? should I get concerned? and if not, how to turn it off.

What is it?

This warning message from LightGBM indicates that during the training process, the algorithm could not find any further splits in the decision tree that would result in a positive gain (i.e., an improvement in the model’s performance). The “best gain” being -inf means that no split was found that would improve the model.

This can happen when the model has already learned the patterns in the data well enough, or when the data is noisy, and further splits would only lead to overfitting. It can also occur when the model’s hyperparameters are not well-tuned for the given dataset.

In most cases, this warning can be safely ignored, as it simply means that the model has reached a point where further splits are not beneficial. However, if you see this warning frequently and the model’s performance is not satisfactory, you may want to consider tuning the hyperparameters or preprocessing the data differently to improve the model’s performance.

How to suppress the warning

for sklearn interface, you can set verbose=-1 when defining the model (not in fit).
for lgb.train interface, you can set verbose=-1 in param dict.


Author: robot learner
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source robot learner !
  TOC