-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Meta-estimator will ignore sample_weight
when a Pipeline
is passed
#21134
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
Labels
Comments
This was referenced Sep 24, 2021
We should that this problem can be fixed by the prototype implementation #20350 for SLEP006 on meta-data routing. |
BenjaminBossan
added a commit
to BenjaminBossan/scikit-learn
that referenced
this issue
Aug 5, 2022
This PR adds metadata routing to CalibratedClassifierCV (CCV). CCV uses a subestimator to create (out of sample) probabilities, which are in turn used to calibrate the probabilities. The metaestimator uses sample_weight. The subestimator may or may not use sample_weight and additional metadata. So far, it was checked if the subestimator has sample_weight in its signature and then they were routed, otherwise not. This is, however, not always ideal, e.g. when the subestimator is itself a pipeline (scikit-learn#21134). With routing, this problem disappears. In addition to these changes, the tests in test_metaestimator_metadata_routing.py have been amended to make them more generic, as right now, they are specific to multioutput.
28 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Related to #18159
While working on #20610, I discovered that we have a silent bug with meta-estimator that uses check the signature of
fit
to know if they should passsample_weight
. Indeed,Pipeline
does require afit_params
where weights can be passed to a specific estimator.However, the previous simple check will thus fail. In some meta-estimator, we will raise an error like in
BaggingClassifier
, however, inCalibrationClassifierCV
, the weights will silently be ignored that is even worse.Steps/Code to Reproduce
Expected Results
Both examples should work identically.
Actual Results
Versions
The text was updated successfully, but these errors were encountered: