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

Skip to content

Allowing the array api to work with covariance OAS - #33600

Merged
ogrisel merged 31 commits into
scikit-learn:mainfrom
bruAristimunha:array-api-oas
Aug 18, 2026
Merged

Allowing the array api to work with covariance OAS#33600
ogrisel merged 31 commits into
scikit-learn:mainfrom
bruAristimunha:array-api-oas

Conversation

@bruAristimunha

@bruAristimunha bruAristimunha commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Towards #33584, the sub-issue about OAS and oas.

What does this implement/fix? Explain your changes.

Basically, allow the methods Covariance OAS and oas to work with the api array contract.

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Any other comments?

It is built on top of #33573, so it is necessary to merge #33573 first.

betatim and others added 10 commits March 17, 2026 18:08
The tests were written as part of a TDD approach during development,
they cover things that the common tests also cover. So removing them to
reduce the amount of duplication.
In some cases it returns flaot64 for float32 input. There are users who
rely on this behaviour.
@bruAristimunha
bruAristimunha marked this pull request as draft March 22, 2026 14:54
@bruAristimunha bruAristimunha changed the title Array api oas [WIP] Allowing the array api to work with covariance OAS Mar 22, 2026
@bruAristimunha

Copy link
Copy Markdown
Contributor Author

Just to let you know, I created the draft PR @betatim, @agramfort, @qbarthelemy. If there's anything I can help with or assist with, please let me know, and thank you again for your attention to this matter 🙏

If we flag it as supporting array API all the classes that inherit from
it also get marked as supporting array API. This doesn't work, so we
need to do this at the end when all estimators support array API.
betatim and others added 9 commits April 7, 2026 16:11
This avoids shifting X and let's us share the implementation with PCA.
Co-authored-by: Quentin Barthélemy <[email protected]>
Convert _oas() and OAS.fit() to use array API compatible operations,
following the same pattern as LedoitWolf from PR scikit-learn#33573.
Vendor array_api_extra from bruAristimunha/array-api-extra#690 which
renames the cov() kwarg from 'bias' to 'correction'. Rename the
changelog entry to 33600 (Bru's PR number) and update its content to
mention only OAS (since EmpiricalCovariance support was reverted in
Tim's branch).
@bruAristimunha
bruAristimunha marked this pull request as ready for review June 3, 2026 17:22
@bruAristimunha

Copy link
Copy Markdown
Contributor Author

@betatim, minimal PR now that #33584 is merged! Can you please review? 🙏🏽

@ogrisel ogrisel moved this to In Progress in Array API Jun 22, 2026
@github-actions github-actions Bot removed the CUDA CI label Jun 22, 2026
@bruAristimunha

Copy link
Copy Markdown
Contributor Author

hey @betatim,

Gentil ping

@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.

LGTM

Comment thread sklearn/covariance/tests/test_covariance.py Outdated
Comment thread sklearn/covariance/tests/test_covariance.py Outdated
Comment thread sklearn/covariance/tests/test_covariance.py Outdated
Co-authored-by: Olivier Grisel <[email protected]>
@github-actions github-actions Bot added CI:Linter failure The linter CI is failing on this PR and removed CUDA CI labels Aug 18, 2026
Comment thread sklearn/covariance/tests/test_covariance.py Outdated
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Aug 18, 2026
@ogrisel ogrisel changed the title [WIP] Allowing the array api to work with covariance OAS Allowing the array api to work with covariance OAS Aug 18, 2026
@ogrisel

ogrisel commented Aug 18, 2026

Copy link
Copy Markdown
Member

Let me fix the failures after the merge with main.

@github-actions github-actions Bot removed the CUDA CI label Aug 18, 2026
@ogrisel
ogrisel enabled auto-merge (squash) August 18, 2026 13:32
@ogrisel

ogrisel commented Aug 18, 2026

Copy link
Copy Markdown
Member

For information, I ran the Intel GPU tests on this PR and they pass:

https://github.com/probabl-ai/scikit-learn-intel-workflow/actions/runs/32142254203/job/95727479117

@ogrisel
ogrisel merged commit 3b82db6 into scikit-learn:main Aug 18, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Array API Aug 18, 2026
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
Co-authored-by: Tim Head <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Quentin Barthélemy <[email protected]>
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks
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.

5 participants