|
8 | 8 |
|
9 | 9 | from sklearn.utils.testing import assert_array_almost_equal |
10 | 10 | from sklearn.utils.testing import assert_array_less |
11 | | -from sklearn.utils.testing import assert_warns_message |
12 | 11 |
|
13 | 12 | from sklearn.covariance import (graphical_lasso, GraphicalLasso, |
14 | 13 | GraphicalLassoCV, empirical_covariance) |
15 | 14 | from sklearn.datasets.samples_generator import make_sparse_spd_matrix |
16 | 15 | from sklearn.externals.six.moves import StringIO |
17 | 16 | from sklearn.utils import check_random_state |
18 | 17 | from sklearn import datasets |
19 | | -from sklearn.utils.fixes import PY3_OR_LATER |
20 | | - |
21 | | -from numpy.testing import assert_equal |
22 | 18 |
|
23 | 19 |
|
24 | 20 | def test_graphical_lasso(random_state=0): |
@@ -137,25 +133,3 @@ def test_graphical_lasso_cv(random_state=1): |
137 | 133 |
|
138 | 134 | # Smoke test with specified alphas |
139 | 135 | GraphicalLassoCV(alphas=[0.8, 0.5], tol=1e-1, n_jobs=1).fit(X) |
140 | | - |
141 | | - |
142 | | -@pytest.mark.filterwarnings('ignore: You should specify a value') # 0.22 |
143 | | -@pytest.mark.skipif(not PY3_OR_LATER, |
144 | | - reason='On Python 2 DeprecationWarning is not issued for some unkown reason.') |
145 | | -def test_deprecated_grid_scores(random_state=1): |
146 | | - dim = 5 |
147 | | - n_samples = 6 |
148 | | - random_state = check_random_state(random_state) |
149 | | - prec = make_sparse_spd_matrix(dim, alpha=.96, |
150 | | - random_state=random_state) |
151 | | - cov = linalg.inv(prec) |
152 | | - X = random_state.multivariate_normal(np.zeros(dim), cov, size=n_samples) |
153 | | - graphical_lasso = GraphicalLassoCV(alphas=[0.8, 0.5], tol=1e-1, n_jobs=1) |
154 | | - graphical_lasso.fit(X) |
155 | | - |
156 | | - depr_message = ("Attribute grid_scores was deprecated in version " |
157 | | - "0.19 and will be removed in 0.21. Use " |
158 | | - "``grid_scores_`` instead") |
159 | | - |
160 | | - with pytest.warns(DeprecationWarning, match=depr_message): |
161 | | - assert_equal(graphical_lasso.grid_scores, graphical_lasso.grid_scores_) |
0 commit comments