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

Skip to content

ENH Add Array API compatibility to 'auc' #29755

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

rwelsch427
Copy link
Contributor

Reference Issues/PRs

Adds to #26024

What does this implement/fix? Explain your changes.

The AUC metric is made to be array api compatible. The original implementation uses np.diff, which is not part of the array api standard. Here, it is a simple difference between two neighboring array elements in a one-dimensional array and thus is replaced by a simple difference of two array slices.
Furthermore, a one-dimensional version of scipy.integrate.trapezoid is implemented to be used in 'auc'.

Any other comments?

This PR includes the changes from #29519 and should be merged after it. The changes from #29519 are in a single commit which can be removed before this PR is merged.

Copy link

✔️ Linting Passed

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

Generated for commit: 249dfae. Link to the linter CI: here

Comment on lines +1051 to +1052
def _trapezoid(y, x=None, dx=1.0, axis=None):
"""Partial (one-dimensional) port of scipy.trapezoid to support the Array API."""
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

2 participants