Skip to content

FIX make roc_auc_score consistent with roc_curve with a single class#27412

Merged
OmarManzoor merged 26 commits intoscikit-learn:mainfrom
glevv:rocauc-typefix
Oct 13, 2024
Merged

FIX make roc_auc_score consistent with roc_curve with a single class#27412
OmarManzoor merged 26 commits intoscikit-learn:mainfrom
glevv:rocauc-typefix

Conversation

@glevv
Copy link
Contributor

@glevv glevv commented Sep 18, 2023

Reference Issues/PRs

Fixes #24381
closes #26176

See also #27047

What does this implement/fix? Explain your changes.

  • replaced ValueError with UndefinedMetricWarning
  • replaced -0.0 with 0.0
  • updated tests

Any other comments?

@github-actions
Copy link

github-actions bot commented Sep 18, 2023

✔️ Linting Passed

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

Generated for commit: 8cbac3e. Link to the linter CI: here

@glevv
Copy link
Contributor Author

glevv commented Sep 20, 2023

Will mark ready for review if #26176 is not going to be merged

@glevv glevv marked this pull request as ready for review January 15, 2024 20:06
@glevv glevv changed the title FIX RocAuc consistency fix FIX RocAuc consistency Jan 16, 2024
@glevv glevv changed the title FIX RocAuc consistency FIX Make ROC AUC score consistent Jan 16, 2024
@glemaitre glemaitre added this to the 1.6 milestone May 18, 2024
@glemaitre glemaitre self-requested a review May 18, 2024 14:30
@glemaitre glemaitre changed the title FIX Make ROC AUC score consistent FIX make roc_auc_score consistent with roc_curve with a single class May 19, 2024
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

We will need an entry in the 1.6 changelog in metrics to acknowlege the change. I think we can consider it as a bug fix.

Copy link
Member

@glemaitre glemaitre 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 @glevv

@glevv
Copy link
Contributor Author

glevv commented Sep 30, 2024

I can't resolve conflicts locally because pre-commit fails on cython-lint with a lot of errors. Can someone help me with this one?

Edit: resolved them on Github.

@glemaitre
Copy link
Member

@OmarManzoor do you think that you can have a look at this PR?

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @glevv.

Minor comments otherwise looks good

metric(y1_row, y2_row)
if "roc_auc" in name:
# for consistency between the `roc_cuve` and `roc_auc_score`
# 0.0 is returned and and `UndefinedMetricWarning` is raised
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 0.0 is returned and and `UndefinedMetricWarning` is raised
# 0.0 is returned and an `UndefinedMetricWarning` is raised

Copy link
Contributor

@OmarManzoor OmarManzoor 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 @glevv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Inconsistency in AUC ROC and AUPR API

3 participants