Skip to content

TST Extend tests for scipy.sparse.*array in sklearn/tests/test_random_projection.py - #27314

Merged
jjerphan merged 33 commits into
scikit-learn:mainfrom
StefanieSenger:sparse_array_test_random_projection
Nov 12, 2023
Merged

jjerphan merged 33 commits into
scikit-learn:mainfrom
StefanieSenger:sparse_array_test_random_projection

Conversation

@StefanieSenger

@StefanieSenger StefanieSenger commented Sep 7, 2023 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Towards #27090.

What does this implement/fix? Explain your changes.

This PR substitutes scipy sparse matrices with the scipy containers introduced in #27095 in the sklearn/tests/test_random_projection.py test file.

Comment

It was a bit tricky, because one of the parametrized functions was re-used outside of test functions (see below). I am not sure why, since it doesn't seem to be re-used afterwards. I made up a solution.

n_samples, n_features = (10, 1000)
n_nonzeros = int(n_samples * n_features / 100.0)
data, data_csr = make_sparse_random_data(n_samples, n_features, n_nonzeros)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Needed Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants