Skip to content

Add an integration test for the use of array API in a non-trivial pipeline - #32873

Closed
ogrisel wants to merge 21 commits into
scikit-learn:mainfrom
ogrisel:array-api-integration-test
Closed

ogrisel wants to merge 21 commits into
scikit-learn:mainfrom
ogrisel:array-api-integration-test

Conversation

@ogrisel

@ogrisel ogrisel commented Dec 9, 2025 •

Copy link
Copy Markdown
Member

I think this kind of test would have help identify some of the problem discovered during the release process earlier.

Note that it still fails because Ridge and LinearDiscriminantAnalysis still do not accept mixed-array inputs (see #28668).

Not sure if we should fix that here or in a PR that introduces a common test for that particular problem.

EDIT: I started to push a fix for the regression case to investigate all the possibly cascading bugs to fix (hiding one after the other). For the regression case we need both #28668 and #32755 and this is enough.

For classification, it seems that there is extra work needed in the private scorer code on top of updating the classifier and the metrics functions themselves.

Comment thread sklearn/utils/tests/test_array_api.py Outdated
(
RidgeClassifier(),
3,
["accuracy"],

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.

I would like to add "roc_auc" or "average_precision" here, but they do not yet support array API at this time: #26024.

@adrinjalali adrinjalali added this to Labs Dec 11, 2025
@adrinjalali adrinjalali moved this to Todo in Labs Dec 11, 2025
@adrinjalali adrinjalali moved this from Todo to In progress in Labs Dec 11, 2025
@ogrisel

ogrisel commented Dec 11, 2025 •

Copy link
Copy Markdown
Member Author

Note that we have the same need for float64/float32 move/downcast to the MPS device as already being investigated in #32755. I will wait for #32755 to be completed before updating this draft PR in that respect.

Comment thread sklearn/metrics/_regression.py Resolved
Comment thread sklearn/metrics/_regression.py Resolved
@github-actions github-actions Bot removed the CUDA CI label Dec 24, 2025
@adrinjalali adrinjalali moved this from In progress to Blocked in Labs Mar 3, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Mar 6, 2026
@ogrisel
ogrisel force-pushed the array-api-integration-test branch from eeedaf4 to 2de2ad3 Compare March 6, 2026 15:16
(
RidgeClassifier(),
3,
["accuracy", "average_precision"],

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.

Note to reviewers: I had to include the fix of #33473 in anticipation in this PR to get this to work.

@adrinjalali adrinjalali moved this from Blocked to In progress in Labs Mar 9, 2026
@adrinjalali adrinjalali moved this from In progress to Todo in Labs Mar 9, 2026
@betatim betatim mentioned this pull request Mar 17, 2026
3 of 4 tasks
_accept_sparse = _get_valid_accept_sparse(sparse.issparse(X), self.solver)
xp, _ = get_namespace(X, y, sample_weight)
xp, _, device = get_namespace_and_device(X)
# XXX: shall we factor the move_to calls into the validate_data helper?

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.

I think we discussed this in the original PR and decided not to. But I don't recall the reasoning.

@ogrisel

ogrisel commented Mar 20, 2026

Copy link
Copy Markdown
Member Author

The tests fail because of a problem related to #33515 (comment). Not sure how to deal with this. I probably won't have time to work on this further in the coming days. Feel free to push to my PR if you want to experiment with a possible solution for this.

@jeremiedbb jeremiedbb moved this from Todo to Stalled in Labs Jun 29, 2026
@ogrisel ogrisel moved this from PR Stalled to Todo in Labs Aug 3, 2026
cursor Bot pushed a commit to ogrisel/scikit-learn that referenced this pull request Aug 27, 2026
Remove the standalone test added from scikit-learn#32873 and assert that an
invalid pos_label is ignored on the existing multiclass
_get_response_values coverage.

Co-authored-by: Olivier Grisel <[email protected]>
@ogrisel

ogrisel commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of #34824.

@ogrisel ogrisel closed this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Labs Aug 27, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Array API Aug 27, 2026
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.

3 participants