Skip to content

MNT Remove deprecated parameters in Displays for 1.10 - #35276

Merged
betatim merged 6 commits into
scikit-learn:mainfrom
AnneBeyer:disp_deprecations
Nov 3, 2026
Merged

betatim merged 6 commits into
scikit-learn:mainfrom
AnneBeyer:disp_deprecations

Conversation

@AnneBeyer

@AnneBeyer AnneBeyer commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Towards #35252

What does this implement/fix? Explain your changes.

Removes the deprecated parameters and the corresponding tests for

  • estimator_name (now name) from PrecisionRecallDisplay
  • y_pred (now y_score) from PrecisionRecallDisplay and DetCurveDisplay

AI usage disclosure

I used AI assistance for:

  • checking that nothing was missed

Any other comments?

I also included some cosmetic replacements (in the RocCurve example where it was deprecated in the last release, and to avoid confusion also in some places where it is only used as a variable name).

Some potential follow-ups that I didn't address here:

  • sklearn/utils/_response.py still uses y_pred as return variable name, even though the docstring already describes it as "Target scores". It has been renamed as y_score in some curves and displays already, and in sklearn/metrics/_ranking.py, y_pred is specifically reserved for "thresholded predictions, internally computed as y_pred = (y_score >= threshold)".
    For consistency, should it also be renamed to y_score in sklearn/utils/_response.py?
  • deprecate estimator_name in favor of name also in CalibrationDisplay.
    (The predictions are called y_prob there, I'm not sure if we'd also want to make it consistent with y_score as well.)

def from_predictions(
cls,
y_true,
y_score=None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

None was only needed when y_pred could be passed instead during the deprecation period, now it is required.

@AnneBeyer AnneBeyer added this to Labs Oct 30, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Labs Oct 30, 2026
@AnneBeyer AnneBeyer moved this from Todo to PR waiting for reviews in Labs Oct 30, 2026

@cakedev0 cakedev0 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, thanks! Just one optional nit on the dev doc.

About the follow-ups you listed:

estimator_name -> name in CalibrationDisplay: +1, it's the last curve display with estimator_name. Once it's done we can also drop the getattr(self, "estimator_name", ...) fallback in _validate_plot_params and the # TODO: Clean-up once estimator_name deprecated in all displays branches in the common tests. Let's do it in a separate PR.

For the other ones, I'm not sure.

Comment thread doc/developers/plotting.rst Resolved

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

I applied Arthur's fix and pushed a commit that fixes the ax.figure.

I think the other follow up items are best done in a new PR or in an issue to discuss what we should do

@betatim
betatim merged commit 1420ffd into scikit-learn:main Nov 3, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from PR waiting for reviews to Done in Labs Nov 3, 2026
@betatim

betatim commented Nov 3, 2026

Copy link
Copy Markdown
Member

Not sure how we count approvals on this PR, but I used the power vested in me by the scikit-learn project to hit merge :D

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.

3 participants