Skip to content

Conversation

Yashp002
Copy link

This PR addresses issue #30352 by replacing ambiguous "chance level" terminology with clearer, more descriptive language across ROC and Precision-Recall display classes.

Changes:

  • ROC curves: "chance level" → "random classifier baseline"
  • PR curves: "chance level" → "prevalence baseline"
  • Updated parameter descriptions to clearly explain what reference lines represent
  • Improves user understanding without breaking API compatibility

Files changed:

  • sklearn/metrics/_plot/_roc_curve_display.py
  • sklearn/metrics/_plot/_precision_recall_display.py

Fixes #30352

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Any other comments?

Copy link

github-actions bot commented Aug 29, 2025

❌ Linting issues

This PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling pre-commit hooks. Instructions to enable them can be found here.

You can see the details of the linting issues under the lint job here


ruff check

ruff detected issues. Please run ruff check --fix --output-format=full locally, fix the remaining issues, and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.11.7.


benchmarks/bench_tsne_mnist.py:10:1: I001 [*] Import block is un-sorted or un-formatted
   |
 8 |   # SPDX-License-Identifier: BSD-3-Clause
 9 |
10 | / import argparse
11 | | import json
12 | | import os
13 | | import os.path as op
14 | | from time import time
15 | |
16 | | import numpy as np
17 | | from joblib import Memory
18 | | from sklearn.utils._openmp_helpers import _openmp_effective_n_threads
19 | |
20 | | from sklearn.datasets import fetch_openml
21 | | from sklearn.decomposition import PCA
22 | | from sklearn.manifold import TSNE
23 | | from sklearn.neighbors import NearestNeighbors
24 | | from sklearn.utils import check_array
25 | | from sklearn.utils import shuffle as _shuffle
   | |_____________________________________________^ I001
26 |
27 |   LOG_DIR = "mnist_tsne_output"
   |
   = help: Organize imports

Found 1 error.
[*] 1 fixable with the `--fix` option.

Generated for commit: 1ac89f8. Link to the linter CI: here

@Yashp002
Copy link
Author

I see some test failures - are these related to my documentation changes or should I fix formatting issues?

@lucyleeow
Copy link
Member

Thanks for your PR, you have some linting issues - #32051 (comment) describes how to fix them

@Yashp002
Copy link
Author

I see several test failures. Since my changes are documentation-only,
I believe these may be unrelated to my PR. Could you help me understand
if any action is needed on my part? And if it is, could you guide me through it.

@lucyleeow
Copy link
Member

Documentation is still checked for correct formatting and yes the CI failures are due to lint problems introduced in this PR.

Please run ruff check --fix --output-format=full locally, fix the remaining issues, and push the changes. Here you can see the detected issues. Note that the installed ruff version is ruff=0.11.7.

Did you try this? You will need to install ruff if you do not have it already.

Please also do not change unrelated files.

@Yashp002
Copy link
Author

Hi @lucyleeow,

Thank you for your feedback and for clarifying the lint and file change issues.

I realized that my previous commits unintentionally included changes to unrelated files (e.g. benchmarks), most likely due to running ruff on the entire repository and getting caught in the pre-commit formatting loop. To keep things clean and focused, I’m going to reset my fork and open a fresh branch/PR containing only the intended documentation changes.

I’ll update you here as soon as the new clean version is ready for review.

Thank you for your guidance and patience!

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
2 participants