Skip to content

ENH update code to check response values of an estimator - #33126

Merged
adrinjalali merged 15 commits into
scikit-learn:mainfrom
qbarthelemy:error_response_values_bis
Feb 5, 2026
Merged

adrinjalali merged 15 commits into
scikit-learn:mainfrom
qbarthelemy:error_response_values_bis

Conversation

@qbarthelemy

Copy link
Copy Markdown
Contributor

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?

@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jan 24, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Labs Jan 26, 2026
@StefanieSenger StefanieSenger moved this from Todo to In progress in Labs Jan 26, 2026

@AnneBeyer AnneBeyer 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.

Thank you for the PR @qbarthelemy!

A few remarks:

  1. To avoid confusion, please change the title to start with "ENH" or "FIX" instead of "DOC" (as this PR does not change the documentation).
  2. Please add a changelog entry like this.
  3. 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 that response_method can 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.

Let me know if you need more help with designing the tests.

Comment thread sklearn/utils/_response.py Resolved
@qbarthelemy qbarthelemy changed the title DOC update code to check response values of an estimator ENH update code to check response values of an estimator Jan 26, 2026
Comment thread sklearn/utils/_response.py Resolved
@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Jan 27, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jan 27, 2026

@AnneBeyer AnneBeyer 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.

Thank you for addressing the comments so fast! Here is another round of feedback:

Comment thread sklearn/utils/_response.py Resolved
Comment thread sklearn/utils/_response.py Resolved
Comment thread sklearn/utils/tests/test_response.py Resolved
Comment thread sklearn/utils/tests/test_response.py Resolved
@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Jan 28, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jan 28, 2026

@AnneBeyer AnneBeyer 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.

A few more small things:

Comment thread sklearn/utils/tests/test_response.py Resolved
Comment thread sklearn/utils/tests/test_response.py Resolved
Comment thread sklearn/utils/tests/test_response.py Resolved
"response_method",
["predict_proba", "decision_function", ["predict_proba", "predict"]],
)
def test_regressor_unsupported_response(pyplot, response_method):

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.

Note for reviewers: This is now tested in sklearn/utils/tests/test_response.py in
test_estimator_unsupported_response

Comment thread sklearn/utils/tests/test_response.py Resolved
Comment thread sklearn/utils/tests/test_response.py Resolved
@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Jan 29, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Jan 29, 2026

@AnneBeyer AnneBeyer 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.

LGTM now, thank you!

@AnneBeyer

Copy link
Copy Markdown
Member

@thomasjpfan, @ogrisel, would you have time to take a look?

@thomasjpfan thomasjpfan 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.

Thank you for the PR @qbarthelemy ! LGTM

@StefanieSenger StefanieSenger moved this from In progress to In progress - High Priority in Labs Feb 2, 2026
@adrinjalali
adrinjalali merged commit 73b45d8 into scikit-learn:main Feb 5, 2026
@github-project-automation github-project-automation Bot moved this from In progress - High Priority to Done in Labs Feb 5, 2026
@qbarthelemy
qbarthelemy deleted the error_response_values_bis branch February 5, 2026 12:37
tonybaloney pushed a commit to tonybaloney/swe-complex-scikit-learn that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC error message when checking response values of an estimator not clear

4 participants