Skip to content

Commit

Permalink
MAINT Fix test_fit_csr_matrix failure on master (scikit-learn#14171)
Browse files Browse the repository at this point in the history
  • Loading branch information
rth authored and thomasjpfan committed Jun 23, 2019
1 parent 9bdcf25 commit 8b002f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sklearn/manifold/tests/test_t_sne.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from io import StringIO
import numpy as np
from numpy.testing import assert_allclose
import scipy.sparse as sp

import pytest
Expand Down Expand Up @@ -274,10 +275,10 @@ def test_fit_csr_matrix():
X[(np.random.randint(0, 50, 25), np.random.randint(0, 2, 25))] = 0.0
X_csr = sp.csr_matrix(X)
tsne = TSNE(n_components=2, perplexity=10, learning_rate=100.0,
random_state=0, method='exact', n_iter=500)
random_state=0, method='exact', n_iter=750)
X_embedded = tsne.fit_transform(X_csr)
assert_almost_equal(trustworthiness(X_csr, X_embedded, n_neighbors=1), 1.0,
decimal=1)
assert_allclose(trustworthiness(X_csr, X_embedded, n_neighbors=1),
1.0, rtol=1.1e-1)


def test_preserve_trustworthiness_approximately_with_precomputed_distances():
Expand Down

0 comments on commit 8b002f2

Please sign in to comment.