Skip to content

FIX make sure _PassthroughScorer works with meta-estimators - #31898

Merged
OmarManzoor merged 9 commits into
scikit-learn:mainfrom
adrinjalali:slep6/pipeline/score
Aug 31, 2025
Merged

OmarManzoor merged 9 commits into
scikit-learn:mainfrom
adrinjalali:slep6/pipeline/score

Conversation

@adrinjalali

Copy link
Copy Markdown
Member

Fixes #30937

The issue was that _PassthroughScorer tries to be smart with metadata-routing info it stores, which only works with simply consumers and not meta estimators (or rather, works when given a MetadataRequest but not MetadataRouter).

This fixes the issue, and improves the implementation in RidgeCV which was arguably not perfect.

cc @StefanieSenger @ogrisel @antoinebaker

@github-actions

github-actions Bot commented Aug 8, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 3a7f7ab. Link to the linter CI: here

@StefanieSenger StefanieSenger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and the explanations yesterday, @adrinjalali!
I have looked through the PR and left some suggestions.

Comment thread sklearn/metrics/_scorer.py Resolved
Comment thread sklearn/metrics/_scorer.py Resolved
Comment thread sklearn/linear_model/_ridge.py Resolved
Comment thread sklearn/linear_model/_ridge.py Resolved
adrinjalali and others added 2 commits August 12, 2025 15:57
@adrinjalali

Copy link
Copy Markdown
Member Author

@OmarManzoor @antoinebaker wanna have a look? Some other PRs depend on this.

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @adrinjalali

@OmarManzoor
OmarManzoor merged commit 285883c into scikit-learn:main Aug 31, 2025
@github-project-automation github-project-automation Bot moved this from To Review to Done in Metadata routing Aug 31, 2025
@adrinjalali
adrinjalali deleted the slep6/pipeline/score branch September 1, 2025 08:39
@jeremiedbb jeremiedbb mentioned this pull request Sep 3, 2025
13 tasks done
DeaMariaLeon pushed a commit to DeaMariaLeon/scikit-learn that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Pipeline score asks to explicitly request sample_weight

3 participants