Skip to content

Commit 5a0043a

Browse files
thomasjpfanrth
authored andcommitted
TST Fix Determinism in test_fit_csr_matrix (scikit-learn#15158)
1 parent ab4089e commit 5a0043a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/manifold/tests/test_t_sne.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ def test_optimization_minimizes_kl_divergence():
265265
@pytest.mark.parametrize('method', ['exact', 'barnes_hut'])
266266
def test_fit_csr_matrix(method):
267267
# X can be a sparse matrix.
268-
random_state = check_random_state(0)
269-
X = random_state.randn(50, 2)
270-
X[(np.random.randint(0, 50, 25), np.random.randint(0, 2, 25))] = 0.0
268+
rng = check_random_state(0)
269+
X = rng.randn(50, 2)
270+
X[(rng.randint(0, 50, 25), rng.randint(0, 2, 25))] = 0.0
271271
X_csr = sp.csr_matrix(X)
272272
tsne = TSNE(n_components=2, perplexity=10, learning_rate=100.0,
273273
random_state=0, method=method, n_iter=750)

0 commit comments

Comments
 (0)