TST Extend tests for scipy.sparse.*array in sklearn/utils/tests/test_sparsefuncs.py#27242
Merged
OmarManzoor merged 2 commits intoscikit-learn:mainfrom Sep 13, 2023
Merged
Conversation
glemaitre
reviewed
Sep 12, 2023
Comment on lines
+444
to
+452
| sp.hstack( | ||
| [ | ||
| csr_container(np.full((13, 1), fill_value=np.nan)), | ||
| sp.random(13, 1, density=0.8, random_state=42), | ||
| ], | ||
| format="csr", | ||
| ), | ||
| ) | ||
| for csr_container in CSR_CONTAINERS |
Member
There was a problem hiding this comment.
Due to the call to sp.hstack, we whill always return a sparse matrix.
The random in the previous tuple is also only testing sparse matrices.
One potential solution is to create sparse matrices, and parametrize with CSR_CONTAINER and intenally cast X1 and X2:
X1 = csr_container(X1)
X2 = csr_container(X2)
Member
|
Otherwise, LGTM for the rest. |
Contributor
Author
|
@glemaitre I removed csr_container in first part of parameterisation and left just np.full if it becomes sparse matrix anyway |
glemaitre
approved these changes
Sep 13, 2023
Member
glemaitre
left a comment
There was a problem hiding this comment.
LGTM. Thanks @Tialo.
Another ready @OmarManzoor
REDVM
pushed a commit
to REDVM/scikit-learn
that referenced
this pull request
Nov 16, 2023
…st_sparsefuncs.py` (scikit-learn#27242)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Towards #27090.
What does this implement/fix? Explain your changes.
Any other comments?
In tests like
test_mean_variance_axis0I checked if*arraywill work with*matrix. If you think that we should check matrices only with matrices, same for arrays, I can reformat parameterisations usingzip