8000 MAINT Fix test_fit_csr_matrix failure on master (#14171) · rth/scikit-learn@8b002f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b002f2

Browse files
rththomasjpfan
authored andcommitted
MAINT Fix test_fit_csr_matrix failure on master (scikit-learn#14171)
1 parent 9bdcf25 commit 8b002f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/manifold/tests/test_t_sne.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
from io import StringIO
33
import numpy as np
4+
from numpy.testing import assert_allclose
45
import scipy.sparse as sp
56

67
import pytest
@@ -274,10 +275,10 @@ def test_fit_csr_matrix():
274275
X[(np.random.randint(0, 50, 25), np.random.randint(0, 2, 25))] = 0.0
275276
X_csr = sp.csr_matrix(X)
276277
tsne = TSNE(n_components=2, perplexity=10, learning_rate=100.0,
277-
random_state=0, method='exact', n_iter=500)
278+
random_state=0, method='exact', n_iter=750)
278279
X_embedded = tsne.fit_transform(X_csr)
279-
assert_almost_equal(trustworthiness(X_csr, X_embedded, n_neighbors=1), 1.0,
280-
decimal=1)
280+
assert_allclose(trustworthiness(X_csr, X_embedded, n_neighbors=1),
281+
1.0, rtol=1.1e-1)
281282

282283

283284
def test_preserve_trustworthiness_approximately_with_precomputed_distances():

0 commit comments

Comments
 (0)
0