[go: nahoru, domu]

Skip to content
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

FEA: Ridge support for Array API compliant inputs #27800

Merged
merged 72 commits into from
Apr 25, 2024

Conversation

fcharras
Copy link
Contributor
@fcharras fcharras commented Nov 17, 2023

What does this implement/fix? Explain your changes.

Follow-up to #26024

This PR is a WIP that aims at bringing support of Ridge for Array API compliant inputs, starting with SVD solver.

elindgren and others added 19 commits August 18, 2023 14:16
Co-authored-by: Tim Head <betatim@gmail.com>
Co-authored-by: Tim Head <betatim@gmail.com>
Some Array API compatible libraries do not have a device called 'cpu'.
Instead we try and detect the lib+device combination that does not
support float64.
…test_affinity_propagation` (scikit-learn#27095)

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Copy link
github-actions bot commented Nov 17, 2023

✔️ Linting Passed

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

Generated for commit: a02e7a4. Link to the linter CI: here

sklearn/utils/extmath.py Outdated Show resolved Hide resolved
@fcharras fcharras force-pushed the enh/ridge_support_for_array_api branch 3 times, most recently from c84731a to 8c38446 Compare November 21, 2023 12:23
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
@lorentzenchr
Copy link
Member

Also I thought on the way that factoring the file _ridge.py a bit could be a good idea to have all config validation at the same place. At the moment there is some in Ridge.fit and some in _ridge_regression (and some checks are done twice) and there is a bizarre redundancy and inconsistency in use of some config keywords. I finally gave up because it started to look very complicated.

This this and this taken together is very confusing, but there is also this (other solvers just check if X_offset is None) and in general I don't understand if there's supposed to be a performance interest in using sag with return_intercept compared to other solvers with intercept computed separately...

I sympathize with you and tried to improve the code base at least a bit in the past. For the sake of this PR, I would advise to focus on the array API only.

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 once all occurrences of {xp.__name__} are actually interpolated to make error messages more informative.

@fcharras
Copy link
Contributor Author

@lorentzenchr thank you for the sympathy 😁 I realize my message maybe sounded harsh, it was not meant to be, sorry about that.


if positive:
raise ValueError(
"The solvers that support positive fitting do not support "
Copy link
Member

Choose a reason for hiding this comment

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

What is "positive fitting"? Is there a different word/words that explain it or am I a rare person for not knowing what it is? Basically, can we make the error message less jargon-y?

Copy link
Member

Choose a reason for hiding this comment

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

We should probably rephrase to "fitting with positivity constraints" or similar.

@ogrisel
Copy link
Member
ogrisel commented Apr 24, 2024

@betatim Franck told me he wouldn't have the time to address your feedback this week so I took the liberty to do it.

There is an unrelated CI failure at APT install time for the ubuntu_atlas job:

Reading package lists...
E: Failed to fetch https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease' is no longer signed.

Hopefully it's transient (although it still fails after clicking the re-run failed jobs button).

EDIT: the last re-run on Azure did work.

@betatim
Copy link
Member
betatim commented Apr 25, 2024

Thanks for all the work Franck and then taking over Olivier. Looks good to me and the robots are happy, so I'll click merge.

@betatim betatim merged commit 171e124 into scikit-learn:main Apr 25, 2024
30 checks passed
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.

None yet

8 participants