-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Adds class_weight to HistGradientBoostingClassifier #22014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Adds class_weight to HistGradientBoostingClassifier #22014
Conversation
Thanks for the PR. While reviewing #17541 I did some experiment with a synthetic imbalanced dataset with RFs or nonlinear preproc + logistic regression, or even just logreg, and each time it seemed that So while I am not opposed to implement this for scikit-learn's HGBDT, I think we should better warn the users that Furthermore, there exist a weird pitfall with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for this PR. The concerns expressed above a probably better dealt with there own independent PR.
…adientBoostingClassifier
…adientBoostingClassifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I synced with main and updated to target 1.2. LGTM, thanks @thomasjpfan
Reference Issues/PRs
Fixes #14735
What does this implement/fix? Explain your changes.
This PR adds
class_weights
toHistGradientBoostingClassifier
.Any other comments?
A
_finalize_sample_weight
is added toBaseHistGradientBoosting
which is used byHistGradientBoostingClassifier
to modify or return sample weights based onclass_weight
.