-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Open
Labels
Description
In the context of:
we've also discussed the possibility of developing a default routing strategy for certain metadata. In most cases this is sample_weight and probably groups in scikit-learn itself.
This would mean, after the introduction of SLEP006, this code would work, and route sample_weight to every object which accepts it (since that's what we think is suitable in this case):
# The exact API is TBD
sklearn.set_config(enable_auto_routing=True)
GridSearchCV(
LogisticRegression(),
scorer=a_scorer_supporting_sample_weight, ...
).fit(..., sample_weight=sw)We can then decide whether or not we want the auto-routing to be enabled by default. One major thing to consider here is that with auto-routing enabled, behavior of the same code can change from version to version for two main reasons:
- we change our mind / find bugs / etc in the routing, and how we want to route things
- estimator A might not support
sample_weightin versionx, but starts supporting it in versionx+1, and with default routing the behavior of the same code changes
Notes
- auto-routing can always be overridden by the user, for more advanced usecases.
- third party developers can use the same mechanism, for
sample_weightor other metadata if they see fit - we might deem SLEP006: globally setting request values #26050 unnecessary if we develop this feature
cc @scikit-learn/core-devs
Jacob-Stevens-Haas
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress