8000 TST Extend tests for `scipy.sparse.*array` in ```sklearn/manifold/tes… · scikit-learn/scikit-learn@6ca15ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ca15ea

Browse files
authored
TST Extend tests for scipy.sparse.*array in sklearn/manifold/tests/test_isomap.py (#27341)
1 parent bffd45f commit 6ca15ea

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

sklearn/manifold/tests/test_isomap.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
assert_allclose_dense_sparse,
1414
assert_array_equal,
1515
)
16+
from sklearn.utils.fixes import CSR_CONTAINERS
1617

1718
eigen_solvers = ["auto", "dense", "arpack"]
1819
path_methods = ["auto", "FW", "D"]
@@ -226,16 +227,21 @@ def test_isomap_clone_bug():
226227

227228
@pytest.mark.parametrize("eigen_solver", eigen_solvers)
228229
@pytest.mark.parametrize("path_method", path_methods)
229-
def test_sparse_input(global_dtype, eigen_solver, path_method, global_random_seed):
230+
@pytest.mark.parametrize("csr_container", CSR_CONTAINERS)
231+
def test_sparse_input(
232+
global_dtype, eigen_solver, path_method, global_random_seed, csr_container
233+
):
230234
# TODO: compare results on dense and sparse data as proposed in:
231235
# https://github.com/scikit-learn/scikit-learn/pull/23585#discussion_r968388186
232-
X = sparse_rand(
233-
100,
234-
3,
235-
density=0.1,
236-
format="csr",
237-
dtype=global_dtype,
238-
random_state=global_random_seed,
236+
X = csr_container(
237+
sparse_rand(
238+
100,
239+
3,
240+
density=0.1,
241+
format="csr",
242+
dtype=global_dtype,
243+
random_state=global_random_seed,
244+
)
239245
)
240246

241247
iso_dense = manifold.Isomap(

0 commit comments

Comments
 (0)
0