Closed alfaro96 closed 3 years ago
Thanks very much for your question. Are you able to create a reproducible example that imports LGBMClassifier
directly from lightgbm
, instead of using sklearn.ensemble._hist_gradient_boosting.utils.get_equivalent_estimator
? That would eliminate a layer of indirection and make this discussion a bit more focused.
I believe it could be a conflict between this https://github.com/microsoft/LightGBM/blob/4ee6399db460644c14847662e1ccd55ebb026c17/src/objective/multiclass_objective.hpp#L31 and this:
if sklearn_params['loss'] == 'categorical_crossentropy':
# LightGBM multiplies hessians by 2 in multiclass loss.
lightgbm_params['min_sum_hessian_in_leaf'] *= 2
lightgbm_params['learning_rate'] *= 2
Thanks very much for your question. Are you able to create a reproducible example that imports
LGBMClassifier
directly fromlightgbm
, instead of usingsklearn.ensemble._hist_gradient_boosting.utils.get_equivalent_estimator
? That would eliminate a layer of indirection and make this discussion a bit more focused.
Thank you @jameslamb for the quick reply. I have modified the original reproducible example to eliminate the indirection.
I'm able to reproduce the values from 2.3.1
by setting learning_rate=3/2
, which is the factor that was introduced before the 3.0.0
release, hope this helps.
I will close the issue since it seems to be solved.
Thank you @jmoralez and @jameslamb for the quick replies!
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.
Description
We are having an issue in
scikit-learn
because the predicted probabilities betweenlightgbm 2.3.1
andlightgbm 3.0.0
are different for theLGBMClassifier
, and I have not found any breaking change in the release notes. Our equivalence tests betweenHistGradientBoostingClassifier
andLGBMClassifier
were passing withlightgbm 2.3.1
, but now are failing withlightgbm 3.0.0
.There has been any breaking change that we have not noticed?
Reproducible example
With
lightgbm 2.3.1
,proba_lightgbm
is:And with
lightgbm 3.0.0
:Environment info
lightgbm
version:2.3.1
and3.0.0
.Commands you used to install
lightgbm
pip install lightgbm==2.3.1
and
pip install lightgbm==3.0.0