Skip to content

[MRG] ENH: add plot_f1_baseline option to PrecisionRecallDisplay.plot #31600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

EvMossan
Copy link

@EvMossan EvMossan commented Jun 20, 2025

Reference Issues/PRs

Closes #30352

What does this implement/fix? Explain your changes.

  • Introduces a new boolean parameter plot_f1_baseline (default: False) to
    :meth:~sklearn.metrics.PrecisionRecallDisplay.plot, which draws the
    hyperbolic F₁-score baseline (Flach & Kull 2015) for the “always-positive”
    classifier.
  • For that baseline curve, style kwargs are forwarded via the existing
    f1_baseline_kw argument.
  • The .plot docstring (with .. versionadded:: 1.8) was updated so that
    this parameter appears in the HTML API reference.
  • A minimal smoke-test was added in
    sklearn/metrics/_plot/tests/test_precision_recall_display.py to verify
    that custom style kwargs (e.g. linestyle) are actually applied.

Any other comments?

All existing tests pass and the new smoke-test covers the styling branch.

Copy link

github-actions bot commented Jun 20, 2025

✔️ Linting Passed

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

Generated for commit: 38327fa. Link to the linter CI: here

@EvMossan EvMossan force-pushed the feat/pr-hyperbolic-baseline branch from ba04696 to 44dbb5b Compare June 20, 2025 10:46
@EvMossan EvMossan changed the title ENH: add plot_f1_baseline option to PrecisionRecallDisplay.plot [MRG] ENH: add plot_f1_baseline option to PrecisionRecallDisplay.plot Jun 22, 2025
@EvMossan
Copy link
Author

EvMossan commented Jul 1, 2025

Hi @scikit-learn/core-devs – friendly ping on this PR. Thanks!

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.

Revisit the "chance level" for the different displays
1 participant