Skip to content

FEA Add array API support to roc_auc_score - #33200

Merged
OmarManzoor merged 52 commits into
scikit-learn:mainfrom
virchan:issues/26024/roc_auc_score
Nov 12, 2026
Merged

OmarManzoor merged 52 commits into
scikit-learn:mainfrom
virchan:issues/26024/roc_auc_score

Conversation

@virchan

@virchan virchan commented Feb 3, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Towards #26024.

What does this implement/fix? Explain your changes.

This PR adds array API support to roc_auc_score.

AI usage disclosure

I used AI assistance for:

  • Research and understanding

Any other comments?

Waiting for CI to turn green.

@virchan

virchan commented Feb 3, 2026

Copy link
Copy Markdown
Member Author

Currently, we are running into an issue with mixed-type promotion in array-api-strict, as reported in #32552:

TypeError: array_api_strict.float64 and array_api_strict.int64 cannot be type promoted together

I'll investigate this further later.

@ogrisel

ogrisel commented Feb 23, 2026

Copy link
Copy Markdown
Member

@virchan I took a quick look and I think I found a way to handle the y_true / pos_label dtype mismatch explicitly. I pushed 2 commits directly to your branch.

Hopefully this will fix the problem.

Comment thread sklearn/metrics/_base.py Resolved
Comment thread sklearn/metrics/_ranking.py Resolved
@ogrisel

ogrisel commented Feb 23, 2026

Copy link
Copy Markdown
Member

Oops I did not run all the tests locally. Let me push a fix.

Comment thread sklearn/metrics/_ranking.py Resolved

@virchan virchan left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All CI have passed, including CUDA.

Thanks @ogrisel for fixing the mixed-dtype issue. The ROC AUC case is slightly tricky because it involves a Boolean dtype in addition to the usual float–integer combination.

Ready for review!

Comment thread sklearn/metrics/_ranking.py Resolved
@virchan
virchan marked this pull request as ready for review February 24, 2026 08:48
@ogrisel

ogrisel commented Mar 6, 2026

Copy link
Copy Markdown
Member

@virchan let's update this PR to add roc_auc_score to METRICS_SUPPORTING_MIXED_NAMESPACE (after syncing with main to get #32755 in).

@ogrisel ogrisel moved this from PR waiting for reviews to PR in progress in Labs Oct 26, 2026
@ogrisel ogrisel moved this from PR in progress to PR waiting for reviews in Labs Nov 2, 2026

@ogrisel ogrisel left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few more test improvements, but otherwise, LGTM.

Any second reviewer, e.g. @lucyleeow @betatim @OmarManzoor @StefanieSenger?

Comment thread sklearn/utils/tests/test_validation.py Resolved
Comment thread sklearn/utils/tests/test_validation.py Resolved
Comment thread sklearn/utils/tests/test_validation.py Resolved
Comment thread sklearn/utils/tests/test_validation.py Resolved
@virchan virchan added the CUDA CI label Nov 2, 2026
@github-actions github-actions Bot removed the CUDA CI label Nov 2, 2026
@virchan

virchan commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

CUDA CI is green.

Intel CI is green.

@ogrisel ogrisel added this to the 1.10 milestone Nov 3, 2026

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you @virchan

@OmarManzoor
OmarManzoor merged commit 7b2b14e into scikit-learn:main Nov 12, 2026
43 checks passed
@github-project-automation github-project-automation Bot moved this from PR waiting for reviews to Done in Labs Nov 12, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Array API Nov 12, 2026
@virchan

virchan commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

Thank you everyone for your time! 🫡

@virchan
virchan deleted the issues/26024/roc_auc_score branch November 12, 2026 08:46
@lucyleeow

Copy link
Copy Markdown
Member

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants