-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MNT Clean-up deprecations for 1.7: sample_weight as positional arg when not consumed #31119
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
Merged
ogrisel
merged 6 commits into
scikit-learn:main
from
jeremiedbb:cln-deprecations-1.7-sample-weight-routed
Apr 15, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
503770a
cln deprecations
jeremiedbb 4e2a234
Update sklearn/ensemble/_bagging.py
jeremiedbb 3871698
Merge branch 'main' into cln-deprecations-1.7-sample-weight-routed
lesteve 0be3e52
add allow list to _raise_for_params
jeremiedbb 0c33330
Merge remote-tracking branch 'upstream/main' into pr/jeremiedbb/31119
jeremiedbb 6f111d1
put back sample_weight in bagging and clean-up ransac same as bagging
jeremiedbb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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.
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.
The
allow
suggestion didn't work here but I removed this validation becausebagging
doesn't consume sample_weight. So it should delegate validation to the underlying estimator.Otherwise, if it turns out that bagging should be a consumer, we'll need to put back sample_weight as explicit param, right ?
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 to keep sample_weight as explicit param for this release, as indeed we will need them for a PR fixing sample weight in Bagging estimators.
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 don't understand how that affects your work, can you elaborate?
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.
It's for #31165 where we use
sample_weight
for drawing the samples instead of passing them to the subestimators. Bagging is then is a consumer ofsample_weight
, and consumer-only as it should not pass them to underlying estimators.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.
Oh interesting. I'd say we can merge this one, and your PR can add it as an explicit parameter. Nothing changes for the user's code, since they can pass
sample_weight=sample_weight
regardless of it being a part ofkwargs
or an explicit parameter.