Repository navigation
ENH make _loss.link.py array API compatible - #33345
Conversation
|
@OmarManzoor ping as you might be interested. |
757176d to
3537154
Compare
OmarManzoor
left a comment
There was a problem hiding this comment.
Thank you for the PR @lorentzenchr
|
The tests are failing because we aren't enabling the context manager |
|
Do you know how to resolve the current CI error?
|
Did you get this error when running on your local system? This seems weird because technically this should be configured in the CI environments already. I think you might need to use the context manager rather than decorating the tests with the array api dispatch config context. |
|
OmarManzoor
left a comment
There was a problem hiding this comment.
Generally looks good now. I'll run the CUDA CI
OmarManzoor
left a comment
There was a problem hiding this comment.
LGTM. Thank you @lorentzenchr
|
CC: @ogrisel |
|
Or @lucyleeow, maybe. |
_loss.link.py array API compatible
| else: | ||
| raw_prediction = rng.uniform(low=-20, high=20, size=(n_samples)) | ||
|
|
||
| assert_allclose(link.link(link.inverse(raw_prediction)), raw_prediction) |
There was a problem hiding this comment.
The update of this check makes it such was we no longer test for this assertion to hold on NumPy inputs with array_api_dispatch=False.
This is point c. of the usual testing policy exposed in:
It makes it extra hard to reviewers of array API support PRs to check that we do not introduce a regression for regular scikit-learn users with array API disabled.
Note that this point will become moot once we move out of experimental and always enabled array API dispatch (see #33444) but as long as it's not the case I would prefer to stick to our policy.
* This is a test for the Interval, it has nothing to do with arrays.
* test_link_inverse_identity only for numpy * new test_link_inverse_array_api
|
Okay let's run the CUDA CI now that we have |
Hihi, yes. Ready to merge from my point of view. |
PR: scikit-learn#33345 Issue: scikit-learn#26024 Base commit: 9292c21 Changed lines: 244
Reference Issues/PRs
Contributes to #26024.
What does this implement/fix? Explain your changes.
This makes the link functions in the private loss module array API compliant (for recent versions of scipy).
AI usage disclosure
None
Any other comments?