TST Extend tests for scipy.sparse.*array in sklearn/utils/tests/test_param_validation.py
#27317
Conversation
scipy.sparse.*array in sklearn/utils/tests/test_param_validation.py
|
Could someone please help why the build is failing |
|
@jeremiedbb I would be inclined at not changing this part of the code for the moment. Maybe we could in the future generate both a sparse array and a sparse matrix. |
|
|
||
| if isinstance(constraint, _SparseMatrices): | ||
| if isinstance(constraint, _SparseContainers): | ||
| return csr_matrix([[0, 1], [1, 0]]) |
There was a problem hiding this comment.
| return csr_matrix([[0, 1], [1, 0]]) | |
| return csr_array([[0, 1], [1, 0]]) |
| if isinstance(constraint, str) and constraint == "sparse container": | ||
| return _SparseContainers() |
There was a problem hiding this comment.
We need to change all the occurrences of "sparse matrix" to "sparse container" for input parameters' validation. Doc-strings also need to be changed accordingly.
|
Hi @naman1608, Do you still have time to finish this contribution? |
|
@Charlie-XIAO: are you interested in continuing this work? |
|
@jjerphan Okay sure, I will take a look later. |
|
@jjerphan Btw, I want to make sure whether we do want to change all occurrences of "sparse matrix" into "sparse container", given #27317 (comment)? Or do we change only for those that have been tested while still keeping the "sparse matrix" option? |
I think this is the best option. We probably want to discuss changing |
|
Hello @Charlie-XIAO, are you still interested in continuing this PR? |
|
@jjerphan Yes I am. I’m extremely sorry for the delay because I was working on a capstone and some exams in the past few weeks. I will be able to work on it soon (within a week). |
|
Hi @Charlie-XIAO, Take your time: it is fine, really. I just wanted to know in case someone else new to the project could have started with a contribution like this. Good luck with your exams! |
|
I'm going to close this one because of #28101. |
Reference Issues/PRs
Towards #27090.
What does this implement/fix? Explain your changes.
Any other comments?