Skip to content

Conversation

otizonaizit
Copy link
Contributor

Reference Issues/PRs

What does this implement/fix? Explain your changes.

This PR changes PCA to use xp.cumulative_sum instead of our own stable_cumsum. It also uses xp.searchsorted from the array API instead of np.searchsorted. For context please refer to the discussion in #31533

Any other comments?

Copy link

✔️ Linting Passed

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

Generated for commit: 872d8b1. Link to the linter CI: here

@otizonaizit otizonaizit marked this pull request as ready for review August 22, 2025 12:44
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM if all tests pass.

@ogrisel
Copy link
Member

ogrisel commented Aug 22, 2025

I don't think we need a changelog entry. It's unlikely there will ever be a numerical stability problem when summing explained variance ratios and I prefer to keep the code simple (no device specific upcast) if not needed.

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @otizonaizit

@OmarManzoor
Copy link
Contributor

Just launched the CUDA CI to check it works fine before merging.

@OmarManzoor OmarManzoor merged commit 450cb20 into scikit-learn:main Aug 22, 2025
51 checks passed
@jeremiedbb jeremiedbb mentioned this pull request Sep 3, 2025
13 tasks
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.

3 participants