-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Sample properties support in transform methods with **transform_params #15370
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
Sample properties support in transform methods with **transform_params #15370
Conversation
I know a number of tests do not pass, just wanted to first see what would fail in the sklearn test suite. I know a lot of the failures are def fit(self, X, y, a=None): then it also has to be defined in: def transform(self, X, a=None): which is I know is missing in all such transformers in the codebase. |
Thanks for doing this @hermidalc and sorry I've not had time to engage in it, especially since we are focused on a release |
No worries, I actually closed the branch because I created a new branch where I took the code you did with the property routing from #9566 merged with what I did so that routes properties to train and test transform, scoring, and predict* and decision_function etc.. It works without issues within From what I understand the property routing design (solution 3) isn't what you envision now, you prefer solution 4? It would make it cleaner. I needed something now that would pass and subset sample properties to fit and transform as well as sample_weight to scorers with I'll make a PR with the new branch in a bit so you can see. |
Thanks. Cool that you're actually using one of these hacks!
How do you deal with fit_transform?
|
I didn't do anything special, properties get routed to both One can envision an enhanced property routing syntax for But I like your solution 4 where children request properties in their classes and then there won't be and prop_routing configuration in user code. Right now I needed to write up something quickly that would work for a project and would have to think more about how your solution 4 would be implemented. |
Reference Issues/PRs
This is relevant to both SLEP006 and #9566
What does this implement/fix? Explain your changes.
Passing of sample properties to
transform
methods via**transform_params
and proper handling inPipeline
andGrid/RandomizedSearchCV
cross-validation and scoring.Any other comments?
This is intended to be exploratory and to help experiment with core devs on what designs might work best or not.