-
-
Notifications
You must be signed in to change notification settings - Fork 26.4k
FIX make 'array-like' reject sparse containers in parameter validation #28101
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
FIX make 'array-like' reject sparse containers in parameter validation #28101
Conversation
…tes/2024-01-29.md#need-attention-reviews
|
My opinion is to let the definition of "array-like" in our glossary (https://scikit-learn.org/stable/glossary.html#term-array-like) be our ground truth and build upon that. Based on the glossary, an array-like is something that gives a meaningful result when you run Regarding the implications on #27950, I think for now it's fine to keep "sparse matrix" for both sparse matrices and sparse arrays. After all we left "sparse matrix" in all docstrings for now as well (although at some point we may want to rename it to sparse container or sparse array everywhere). I pushed a commit that I took from #27950 to test param_validation against sparse containers in this PR since it's related and I think we should discard everything else in #27950. @glemaitre What do you think ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @Charlie-XIAO
Fixes #28099. This still needs discussions, see the referenced issue, as for whether to close this PR or how to improve it.
"array-like" is currently a superset of "sparse matrix" which I do not think is the desired behavior, so this PR excludes sparse containers from the "array-like" constraints.
The other modifications are according to the failing tests, so essentially I added the "sparse matrix" option if (1) originally it has only "array-like" and (2) there exist at least some tests that use sparse matrices as input.
https://github.com/scikit-learn/administrative/blob/master/meeting_notes/2024-01-29.md#need-attention-reviews