Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH add Array API support ford2_pinball_score andd2_absolute_error_score#31671

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
virchan wants to merge4 commits intoscikit-learn:main
base:main
Choose a base branch
Loading
fromvirchan:issues/26024/d2_absolute_error_score_and_d2_pinball_score

Conversation

virchan
Copy link
Member

Reference Issues/PRs

Towards#26024

What does this implement/fix? Explain your changes.

Adds Array API support ford2_pinball_score andd2_absolute_error_score.

Any other comments?

N/A

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJun 28, 2025
edited
Loading

✔️ Linting Passed

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

Generated for commit:133d82a. Link to the linter CI:here

@virchanvirchan changed the titleadd Array API support tod2_absolute_error_score and `d2_pinball_sc…ENH add Array API support ford2_pinball_score andd2_absolute_error_scoreJun 28, 2025
Copy link
MemberAuthor

@virchanvirchan left a comment

Choose a reason for hiding this comment

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

I think we need to add Array API support for thequantile function to handle cases wheresample_weight isNone. I'll work on that later.

@lucyleeow
Copy link
Member

Scipyquantile now supports array API (but not weights):scipy/scipy#22352

Theirquantile function is probably (?) faster than ours (benchmarking needed) and it would be nice to not maintain another array API function. But it was added after our min scipy.

I'll open an RFC issue about adding quantile to array api extra, it's been on my todo for a while.

virchan reacted with thumbs up emoji

@lucyleeow
Copy link
Member

data-apis/array-api-extra#340 may take a long while, so we should still decide here what we want to do, even if it is 'temporary'.

virchan reacted with thumbs up emoji

@virchan
Copy link
MemberAuthor

Thanks@lucyleeow!

lucyleeow reacted with thumbs up emoji

@OmarManzoor
Copy link
Contributor

OmarManzoor commentedJun 30, 2025
edited
Loading

Do we really need a dedicated implementation forquantile inarray-api-extra when all the relevant array api libraries support it (I checked that dask and jax also support this aside from cupy and Pytorch)? Maybe all we actually need is a helper that can call the respective function of the library under consideration (Pytorch has a different name for the dim parameter) and simply convert to numpy to handlearray-api-strict.

@lucascolley
Copy link
Contributor

Do we really need a dedicated implementation for quantile in array-api-extra when all the relevant array api libraries support it

  1. The dedicated implementation should not be too difficult, ashttps://github.com/scipy/scipy/blob/main/scipy/stats/_quantile.py already supports the standard

  2. The delegation to existing libraries you describe can be covered by array-api-extra too:https://github.com/data-apis/array-api-extra/blob/main/src/array_api_extra/_delegation.py

@OmarManzoor
Copy link
Contributor

  1. The delegation to existing libraries you describe can be covered by array-api-extra too:https://github.com/data-apis/array-api-extra/blob/main/src/array_api_extra/_delegation.py

@lucascolley Thanks for the feedback. I think it makes sense to add it there then. Do we need a new implementation though when we don't really need it? I guess it would require copying the relevant code from scipy?

@lucascolley
Copy link
Contributor

Do we need a new implementation though when we don't really need it?

Yes, it is good to future-proof and not rely on existing libraries. cf. Tim's comment over atdata-apis/array-api-extra#340 (comment) let's continue discussion over there

OmarManzoor and virchan reacted with thumbs up emoji

@ogrisel
Copy link
Member

Do we need a new implementation though when we don't really need it?

Also, I am not sure all libraries support weighted quantiles.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@virchan@lucyleeow@OmarManzoor@lucascolley@ogrisel

[8]ページ先頭

©2009-2025 Movatter.jp