Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lucyleeow
Copy link
Member

@lucyleeow lucyleeow commented Aug 29, 2025

Reference Issues/PRs

closes #32036

What does this implement/fix? Explain your changes.

  • Improves the error message when sparse input is binary or multiclass
    • note I decided to catch the error and re-raise because the error is 2 functions deep and thought it was easier than adding a parameter and passing it through
    • Adds test
  • Improves docstring of classification metrics that support sparse to note that sparse is only supported when target/label types is multilabel.

Any other comments?

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

✔️ Linting Passed

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

Generated for commit: 1247a26. Link to the linter CI: here

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

This looks great. Please add a changelog entry. Improving error message is a great UX improvement.

@lucyleeow lucyleeow added the Waiting for Second Reviewer First reviewer is done, need a second one! label Aug 29, 2025
Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @lucyleeow

@jeremiedbb jeremiedbb merged commit d80a24d into scikit-learn:main Sep 9, 2025
39 of 40 checks passed
@lucyleeow lucyleeow deleted the sparse_metric branch September 10, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:metrics module:utils Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classification metrics don't seem to support sparse?

3 participants