-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Make check_sample_weights_invariance cv-aware #29796
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
Conversation
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.
Thanks @antoinebaker for the PR. I believe this is already a net improvement. Could you please remove the "Draft" status?
I am +1 for merging as is and then follow up with extra PRs to:
- split
check_sample_weights_invariance
into two methods:- a simple
check_unit_sample_weight
(basically thekind="ones"
case of the current implementation; - a more thorough
check_sample_weights_invariance
that implements the generic case with weight vs repetition equivalence with random integer weights between 0 and 3 similarly to the testing strategy implemented in Fix sample weight handling in scoring _log_reg_scoring_path #29419 (and discussed in RFC Sample weight invariance properties #15657 (comment)). This test will need to be made cv aware.
- a simple
- Investigate if we can fix the behavior of
GridSearchCV
and friends even when metadata-routing is disabled; - Find a way to run the
check_unit_sample_weight
andcheck_sample_weights_invariance
checks on all meta-estimators, includingGridSearchCV
(&*SearchCV
) and some canonical pipelines such as the ones defined intest_metaestimators.py
. We might wait for the refactoring by @adrinjalali and @glemaitre to progress before embarking on those though. - Think about how we can run those checks with and without metadata routing enabled;
- Make sure that the proper behavior works when metadata routing is enabled (related to SLEP006: default routing #26179).
/cc @jeremiedbb. |
I think we can remove the specific test for CalibratedClassifierCV
now that it's properly tested in the common tests.
When we do that, we will also be able to remove this test
|
Indeed. I checked For |
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.
LGTM, thanks
do we wait to merge #29442 before this one or we trust the quick check we did during the live debbuging session ? |
Let's merge as is and iterate to limit dependencies between PRs. |
@ogrisel with the new |
Handling of CV estimators in
check_sample_weight_invariance
following#16298 (comment)