Skip to content

test_fit_csr_matrix failing on Linux py35_conda_openblas #14168

@jnothman

Description

@jnothman

Azure is choking on this tSNE test. I don't think we've changed anything here recently.

_____________________________ test_fit_csr_matrix ______________________________

    def test_fit_csr_matrix():
        # X can be a sparse matrix.
        random_state = check_random_state(0)
        X = random_state.randn(50, 2)
        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)
        X_embedded = tsne.fit_transform(X_csr)
        assert_almost_equal(trustworthiness(X_csr, X_embedded, n_neighbors=1), 1.0,
>                           decimal=1)
E       AssertionError: 
E       Arrays are not almost equal to 1 decimals
E        ACTUAL: 0.93583333333333329
E        DESIRED: 1.0

X          = array([[ 0.        ,  0.        ],
       [ 0.97873798,  0.        ],
       [ 1.86755799, -0.97727788],
       [ 0.95... 0.97663904],
       [ 0.3563664 ,  0.70657317],
       [ 0.01050002,  1.78587049],
       [ 0.12691209,  0.40198936]])
X_csr      = <50x2 sparse matrix of type '<class 'numpy.float64'>'
	with 78 stored elements in Compressed Sparse Row format>
X_embedded = array([[ -28.21473122,   24.69126129],
       [ -43.97845459,  -39.56318283],
       [ -82.35324097,  -55.03578568],
 ...44132996,   48.34313583],
       [  98.00850677,   70.21777344],
       [  17.60460854,   52.21545029]], dtype=float32)
random_state = <mtrand.RandomState object at 0x7f0d05283ea0>
tsne       = TSNE(angle=0.5, early_exaggeration=12.0, init='random', learning_rate=100.0,
     method='exact', metric='euclidean', ...orm=1e-07, n_components=2,
     n_iter=500, n_iter_without_progress=300, perplexity=10, random_state=0,
     verbose=0)

../1/s/sklearn/manifold/tests/test_t_sne.py:280: AssertionError

Versions:


Package         Version  
--------------- ---------
atomicwrites    1.3.0    
attrs           19.1.0   
certifi         2018.8.24
chardet         3.0.4    
codecov         2.0.15   
coverage        4.5.1    
cycler          0.10.0   
Cython          0.28.5   
idna            2.8      
joblib          0.12.3   
matplotlib      1.5.1    
more-itertools  4.3.0    
numpy           1.11.0   
olefile         0.46     
pathlib2        2.3.2    
Pillow          4.0.0    
pip             10.0.1   
pluggy          0.11.0   
py              1.6.0    
pyparsing       2.4.0    
pytest          3.8.1    
pytest-cov      2.7.1    
python-dateutil 2.7.3    
pytz            2019.1   
requests        2.22.0   
scipy           0.17.0   
setuptools      40.2.0   
six             1.11.0   
urllib3         1.25.3   
wheel           0.31.1 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions