Repository navigation
FEAT allow configuring automatically requested metadata - #31401
adrinjalali wants to merge 8 commits into
Conversation
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
StefanieSenger
left a comment
There was a problem hiding this comment.
I like the naming of "auto-requests", that I think is very intuitive.
Still, auto-requests here are contrasted with "empty" metadata requests and "default" metadata requests. If I understood correctly, then the "default" is "empty" requests, so these should both be referred to via the same terms.
| Auto-requested metadata. These metadata request values override default | ||
| request values if `set_config(metadata_request_policy="auto")` is set. |
There was a problem hiding this comment.
Maybe explain this a bit better:
| Auto-requested metadata. These metadata request values override default | |
| request values if `set_config(metadata_request_policy="auto")` is set. | |
| Auto-requested metadata. Keyword arguments where the key is a method | |
| name (e.g., 'fit', 'predict') and the value is a metadata request | |
| (either a str or a list of str). These override default request values | |
| if `set_config(metadata_request_policy="auto")` is set. |
| # Here's an example demonstrating both approaches: | ||
|
|
||
|
|
||
| class DefaultRoutingClassifier(ClassifierMixin, BaseEstimator): |
There was a problem hiding this comment.
Could we rename this, since it's not a router?
| class DefaultRoutingClassifier(ClassifierMixin, BaseEstimator): | |
| class DefaultClassifier(ClassifierMixin, BaseEstimator): |
| - `"auto"`: Metadata is requested if the consumer has flagged it as an | ||
| auto-request. |
There was a problem hiding this comment.
Trying to find a formulation that communicates that this entails that a sub-part of the metadata can be requested. I think it's not clear otherwise.
I would also avoid talking about "the" consumer, since there can be several.
| - `"auto"`: Metadata is requested if the consumer has flagged it as an | |
| auto-request. | |
| - `"auto"`: Only the subset of metadata flagged by consumers for | |
| auto-request will be requested. |
| Parameters | ||
| ---------- | ||
| **auto_requests : str or list of str | ||
| Auto-requested metadata. These metadata request values override default |
There was a problem hiding this comment.
The default are the empty requests, right?
| Auto-requested metadata. These metadata request values override default | |
| Auto-requested metadata. These metadata request values override empty |
|
superseded by #31413 |
EDIT: I think I prefer #31413
Alternative to #30946
The approach here is to avoid adding a new function to the base class, and instead handle it via the same
get_metadata_routing.However, this solution changes the signature of the method, which is not idea. We could at the same time deprecate the method and replace it with a
__sklearn_get_metadata_routing__method with a new signature, and the__sklearn__pattern as the rest of the developer API we have now.cc @antoinebaker @ogrisel @StefanieSenger
This is not complete, putting here for us to be able to have a more concrete view of the idea.
The idea is that developer / user code looks like this: