File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
sklearn/decomposition/tests Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11import numpy as np
2+ from scipy import linalg
23from sklearn .decomposition import nmf
34
45from sklearn .utils .testing import assert_true
@@ -33,8 +34,8 @@ def test_initialize_close():
3334 """
3435 A = np .abs (random_state .randn (10 , 10 ))
3536 W , H = nmf ._initialize_nmf (A , 10 )
36- error = np . linalg .norm (np .dot (W , H ) - A )
37- sdev = np . linalg .norm (A - A .mean ())
37+ error = linalg .norm (np .dot (W , H ) - A )
38+ sdev = linalg .norm (A - A .mean ())
3839 assert_true (error <= sdev )
3940
4041
@@ -147,7 +148,7 @@ def test_sparse_input():
147148 random_state = 999 )
148149 T2 = pg_nmf .fit_transform (A_sparse )
149150 assert_array_almost_equal (pg_nmf .reconstruction_err_ ,
150- np . linalg .norm (A - np .dot (T2 , pg_nmf .components_ ), 'fro' ))
151+ linalg .norm (A - np .dot (T2 , pg_nmf .components_ ), 'fro' ))
151152 assert_array_almost_equal (T1 , T2 )
152153
153154 # same with sparseness
You can’t perform that action at this time.
0 commit comments