-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Add metadata routing params support in the predict method of BaggingClassifier/Regressor
#30808
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
Comments
In the first round of implementation, we focused on |
Thank you for the feedback! |
cc @StefanieSenger in case you fancy taking on this one. |
Yes, I'm happy to take care of it. |
Out of curiosity, what is your use case that needs routing metadata in predict methods, @aperezlebel? |
I'm working with an estimator that uses feature names in addition to the feature values. When I wrap the estimator inside a BaggingClassifier or BaggingRegressor, I can't pass the feature names to the predict method, even when using a pandas dataframe because the bagging estimator converts it to a numpy array before passing it to the base estimator. Thank you @StefanieSenger for taking care of this PR! |
Thank you @aperezlebel, I feel what you describe is something scikit-learn would offer without metadata routing. I didn't check how to do that precisely though. Anyways, seems the routing to predict will be in version 1.7. |
Describe the workflow you want to enable
Hello! I'm trying to use metadata routing with
BaggingClassifier
andBaggingRegressor
however it is implemented for thefit
method, not thepredict
one. I am wondering if there is a particular reason for not doing it on the predict function or if this is a feature that could be added. This would enable situations like the following, which currently gives an error:Describe your proposed solution
Similar to the fit method, something like:
However, I don't have enough understanding of the metadata routing implementation to know exactly what should be done.
Describe alternatives you've considered, if relevant
No response
Additional context
I tried to have a look at the history of PRs/Issues to find a discussion around this point, but could not find it in the PR introducing the metadata routing to these estimators (#28432).
The text was updated successfully, but these errors were encountered: