Open ohbtorres opened 10 months ago
Hey @ohbtorres, thanks for using LightGBM. Early stopping isn't supported in dart, you should be getting this warning: https://github.com/microsoft/LightGBM/blob/0a9a6bbf6d96cb01c3fdc7ace6b13da828857c82/python-package/lightgbm/callback.py#L325 Is it not showing?
Hi @jmoralez, thank you for your answer.
You are right, changing the boosting_type
the callback works. Thanks a lot!
Is there any information about this here?
I am not getting this warning message
Is there any information about this here?
I think we could add it here.
I am not getting this warning message
Did you disable Python's warnings? Running your example I get the following:
[LightGBM] [Info] Number of positive: 5074, number of negative: 4926
[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000097 seconds.
You can set `force_row_wise=true` to remove the overhead.
And if memory is not enough, you can set `force_col_wise=true`.
[LightGBM] [Info] Total Bins 40
[LightGBM] [Info] Number of data points in the train set: 10000, number of used features: 2
[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.507400 -> initscore=0.029602
[LightGBM] [Info] Start training from score 0.029602
/hdd/github/LightGBM/python-package/lightgbm/callback.py:325: UserWarning: Early stopping is not available in dart mode
_log_warning('Early stopping is not available in dart mode')
I didn't. I don't know what coulb be happening. However, I got it, and early stopping is working fine. Thanks @jmoralez!
Would you like to add that dart isn't supported in the early stopping callback docstring?
Description
Using
lightgbm.early_stopping
does not work while using Scikit-learn API, and the training still remains after the early stop condition occursReproducible example
The result will be this
The binary_logloss starts with 0.693169 and end with 0.697759 and no stopping happened
Environment info
LightGBM version or commit hash: 4.1.0
Command(s) you used to install LightGBM
pandas==2.0.3 numpy==1.24.4