-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FEAT multioutput routes metadata #22986
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
FEAT multioutput routes metadata #22986
Conversation
This reverts commit a663b86.
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.
This is one of the cases where the current system just works, and the proposal seems highly bureaucratised :(
I do wonder if we should just be using fit
params without distinguishing from partial_fit
. Did we have use cases for distinguishing fit
and partial_fit
params?
I started writing this: Another alternative that I have explored for meta-estimators such as this one, which "only" pass metadata to the single sub-estimator they have, is to behave like a consumer rather than a router, and expose their sub-estimator's requests. And realized there could potentially an issue with this implementation since
If we do that, do we want to also consider |
I'm not sure what to do with this concern @jnothman 😆 But I also don't think it's too bad. If this estimator would accept
Seems like we're keeping them separate then? (#22988) |
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.
Sorry for the very slow review!!
The summary of the latest change: Previously the code would try to route parameters, and if there was an exception, it would try to assume all those parameters as requested, and then route again. Now, the exception includes enough information that when raised, we can check if those relevant parameters can be routed and warned or if there should be an error. It also made me change the signature of |
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.
At a first read, it seems pretty straightforward.
I will have to make an additional pass and look more into the details of the _is_default_request
just to be sure that there is nothing that can go sideways.
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 for the update. I hope the complexity of the routing mechanism does not get any higher than this.
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.
Yes, this is certainly much neater than the more magic solution before. I'm not sure we're going to quite achieve @thomasjpfan's request that "the complexity of the routing mechanism does not get any higher than this." but at least this lays most of the groundwork, so that the rest of the implementations are complicated, not complex. Congrats @adrinjalali!
In terms of the impact on users, however, this remains one of the cases where the implicit behaviour was actually okay: forwarding on any kwargs in fit
to the child estimator. Now we will force the user to explicitly request these. I'd like to know from others: Is this a reasonable burden on the user? Is there a way to avoid it without major inconsistencies between simple routing as presented here and the more complex routing of a GridSearchCV or Pipeline (where there are many candidate destinations)?
Opened #23928 to discuss the verbosity issue. |
The lines reported not covered are the dummy estimators. I think this is fine if they are not tested. |
Thanks @adrinjalali |
Towards #22893
This is the first PR which handles deprecation of old code where users pass metadata w/o setting request values. This PR adds the machinery to do so, and adds routing to MultiOutput estimators.
@agramfort may be interested in this as well.
ping @jnothman @thomasjpfan @lorentzenchr