Skip to content

DOC Fix pos_label docstring in Display classes #31696

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 3 commits into
base: main
Choose a base branch
from

Conversation

lucyleeow
Copy link
Member

@lucyleeow lucyleeow commented Jul 3, 2025

Reference Issues/PRs

Noticed when working on #28972

Specify that pos_label from init is used to label the x and y axes. Fixes some inaccuracies:

  • pos_label parameter in display class init is not able to be infer pos_label (as it does not have access to estimator or predictions).
  • it is not used in legend labelling, only in the x and y axes

Fix docstrings accordingly.

What does this implement/fix? Explain your changes.

Any other comments?

@lucyleeow lucyleeow added the Quick Review For PRs that are quick to review label Jul 3, 2025
Copy link

github-actions bot commented Jul 3, 2025

✔️ Linting Passed

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

Generated for commit: 38a1be6. Link to the linter CI: here

@@ -72,8 +72,7 @@ class RocCurveDisplay(_BinaryClassifierCurveDisplayMixin):

pos_label : int, float, bool or str, default=None
The class considered as the positive class when computing the roc auc
metrics. By default, `estimators.classes_[1]` is considered
as the positive class.
metrics. Used for labelling the axes. If `None`, not included in labels.
Copy link
Member

Choose a reason for hiding this comment

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

I was a bit confused by the wording until I ran some experiments in Jupyter. 😅

What do you think about:

Suggested change
metrics. Used for labelling the axes. If `None`, not included in labels.
metrics. If not `None`, this value is displayed in the x- and y-axis labels.

Copy link
Member Author

@lucyleeow lucyleeow Jul 7, 2025

Choose a reason for hiding this comment

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

This is MUCH better. I didn't like what I had but I couldn't think of how to improve. Let me update other docstrings to say something along these lines too, as it would be nice to know what pos_label is actually doing - just updating figure labels!

@lucyleeow lucyleeow changed the title DOC Fix pos_label docstring in RocCurveDisplay DOC Fix pos_label docstring in Display classes Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation module:metrics Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants