Repository navigation
ENH update code to check response values of an estimator - #33126
Merged
adrinjalali merged 15 commits intoFeb 5, 2026
Merged
Conversation
AnneBeyer
reviewed
Jan 26, 2026
AnneBeyer
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR @qbarthelemy!
A few remarks:
- To avoid confusion, please change the title to start with "ENH" or "FIX" instead of "DOC" (as this PR does not change the documentation).
- Please add a changelog entry like this.
- Your tests are currently failing. In general, we need two new tests here:
- one that checks that no error is thrown for all types of estimators with their supported
response_methods, and - one that checks that the expected error is thrown for unsupported
response_methods.
Note thatresponse_methodcan be a string or a list of strings, both cases should be part of the tests.
All existing tests should not be changed (or only adapted according to the new error message), to make sure nothing else is affected by your change.
- one that checks that no error is thrown for all types of estimators with their supported
Let me know if you need more help with designing the tests.
Co-authored-by: Anne Beyer <[email protected]>
AnneBeyer
reviewed
Jan 26, 2026
AnneBeyer
reviewed
Jan 27, 2026
AnneBeyer
left a comment
Member
There was a problem hiding this comment.
Thank you for addressing the comments so fast! Here is another round of feedback:
Co-authored-by: Anne Beyer <[email protected]>
AnneBeyer
reviewed
Jan 29, 2026
| "response_method", | ||
| ["predict_proba", "decision_function", ["predict_proba", "predict"]], | ||
| ) | ||
| def test_regressor_unsupported_response(pyplot, response_method): |
Member
There was a problem hiding this comment.
Note for reviewers: This is now tested in sklearn/utils/tests/test_response.py in
test_estimator_unsupported_response
Member
|
@thomasjpfan, @ogrisel, would you have time to take a look? |
thomasjpfan
approved these changes
Feb 1, 2026
thomasjpfan
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR @qbarthelemy ! LGTM
4 tasks
adrinjalali
approved these changes
Feb 5, 2026
tonybaloney
pushed a commit
to tonybaloney/swe-complex-scikit-learn
that referenced
this pull request
Mar 19, 2026
PR: scikit-learn#33126 Issue: scikit-learn#33093 Base commit: e154bfc Changed lines: 137
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.
Reference Issues/PRs
Fixes #33093. See also #33084.
What does this implement/fix? Explain your changes.
It implements suggestions made here #33093 (comment)
AI usage disclosure
I did not use AI assistance.
Any other comments?