Repository navigation
[python-package] ignore scikit-learn 'check_sample_weight_equivalence' estimator check (fixes #6678) - #6679
Merged
Conversation
β¦' estimator check (fixes #6678)
jameslamb
commented
Oct 14, 2024
| fsspec=2024.5.* | ||
| msgpack-python=1.0.* | ||
| pluggy=1.5.* | ||
| pyparsing=3.1.4 |
Member
Author
There was a problem hiding this comment.
While working on this, I discovered #6680.
Have reported that issue upstream: conda-forge/pyparsing-feedstock#48
For LightGBM's purposes, testing on an old version of Python, let's just pin it as we do other libraries in these environments.
jameslamb
marked this pull request as ready for review
October 14, 2024 03:34
jameslamb
requested review from
StrikerRUS,
borchero,
guolinke,
jmoralez and
shiyu1994
as code owners
October 14, 2024 03:34
StrikerRUS
approved these changes
Oct 15, 2024
StrikerRUS
left a comment
Collaborator
There was a problem hiding this comment.
I think just skipping this compliance check is the right thing for
lightgbmright now.
Agree with you!
Thanks for the fast fix!
Contributor
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6678
Fixes #6680
As of scikit-learn/scikit-learn#29818 (which will be in
scikit-learn1.6),scikit-learncontains an estimator check that enforces the following behavior:This new check is breaking CI here... LightGBM does not work that way.
weight=0.0samples' feature values still contribute to feature distributions and therefore bin boundaries inDatasethistograms (How observations with sample_weight of zero influence the fit of LGBMRegressorΒ #5553)1sample for the perspective of count-based hyper-parameters likemin_data_in_leaf([R-package] Weighted Training - Different results (cross entropy) when using .weight column Vs inputting the expanded data (repeated rows = .weight times)Β #5626 (comment))This PR proposes skipping that estimator check, just as
scikit-learnis currently doing forHistGradientBoosting*estimators (code link).Notes for Reviewers
We could modify LightGBM's
scikit-learnestimators to match this expected behavior by excluding rows withweight=0and creating copies of rows withint(weight)>=2before passing it through toDatasethere:https://github.com/microsoft/LightGBM/blob/bbeecc09af946c5ff9b84d1ada4749a9f26bca31/python-package/lightgbm/sklearn.py#L938-L947
I don't support doing that... I think it'd add significant complexity (do count-based hyperparameters need to be modified? how does this affect Dask estimators?) for questionable benefit.
I think just skipping this compliance check is the right thing for
lightgbmright now.