Add scikit-learn metadata routing support to BaseRegressor - #77
Closed
yousefkhedr777 wants to merge 1 commit into
Closed
Add scikit-learn metadata routing support to BaseRegressor#77yousefkhedr777 wants to merge 1 commit into
yousefkhedr777 wants to merge 1 commit into
Conversation
yousefkhedr777
force-pushed
the
feature/metadata-routing-geometry
branch
8 times, most recently
from
January 28, 2026 01:27
d9c7ce4 to
40668e1
Compare
|
Just a heads-up based on earlier discussions: this relies on scikit-learn’s metadata routing (MetadataRequest, _fit_context), which is still experimental/private .It might be safer to avoid this for now and stick to explicit geometry handling until the API stabilises :) |
yousefkhedr777
force-pushed
the
feature/metadata-routing-geometry
branch
2 times, most recently
from
January 31, 2026 19:40
8cc2ae9 to
2d492e7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #77 +/- ##
==========================================
- Coverage 91.36% 91.22% -0.15%
==========================================
Files 6 6
Lines 799 809 +10
==========================================
+ Hits 730 738 +8
- Misses 69 71 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
yousefkhedr777
force-pushed
the
feature/metadata-routing-geometry
branch
from
January 31, 2026 20:47
2d492e7 to
f1f00fd
Compare
Member
|
What is it you're actually doing here, besides polluting the PR with your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
//notes
-i think metadata is the best way because implements metadata routing for the
geometryparameter within theBaseRegressorclass because no existing public APIs were changed and users not relying on Pipeline or GridSearchCV are unaffected and existing workflows continue to work as before-This change is designed for scikit-learn ≥ 1.3, where metadata routing is supported.
Older versions of scikit-learn are not affected by this change.
Key changes:
geometryas a required metadata input to be only keyword to avoids misuse in preprocessing steps for:fitpredictscorePipelineandGridSearchCVwhenenable_metadata_routing=Trueis configured.Verified the logic using a mock estimator to ensure metadata is correctly routed through a Pipeline.