@@ -61,6 +61,8 @@ def test_covariance():
61
61
X_1sample = np .arange (5 )
62
62
cov = EmpiricalCovariance ()
63
63
assert_warns (UserWarning , cov .fit , X_1sample )
64
+ assert_array_almost_equal (cov .covariance_ ,
65
+ np .zeros (shape = (5 , 5 ), dtype = np .float64 ))
64
66
65
67
# test integer type
66
68
X_integer = np .asarray ([[0 , 1 ], [1 , 0 ]])
@@ -181,9 +183,11 @@ def test_ledoit_wolf():
181
183
182
184
# test with one sample
183
185
# FIXME I don't know what this test does
184
- #X_1sample = np.arange(5)
185
- #lw = LedoitWolf()
186
- #assert_warns(UserWarning, lw.fit, X_1sample)
186
+ X_1sample = np .arange (5 )
187
+ lw = LedoitWolf ()
188
+ assert_warns (UserWarning , lw .fit , X_1sample )
189
+ assert_array_almost_equal (lw .covariance_ ,
190
+ np .zeros (shape = (5 , 5 ), dtype = np .float64 ))
187
191
188
192
# test shrinkage coeff on a simple data set (without saving precision)
189
193
lw = LedoitWolf (store_precision = False )
@@ -253,9 +257,11 @@ def test_oas():
253
257
254
258
# test with one sample
255
259
# FIXME I don't know what this test does
256
- #X_1sample = np.arange(5)
257
- #oa = OAS()
258
- #assert_warns(UserWarning, oa.fit, X_1sample)
260
+ X_1sample = np .arange (5 )
261
+ oa = OAS ()
262
+ assert_warns (UserWarning , oa .fit , X_1sample )
263
+ assert_array_almost_equal (oa .covariance_ ,
264
+ np .zeros (shape = (5 , 5 ), dtype = np .float64 ))
259
265
260
266
# test shrinkage coeff on a simple data set (without saving precision)
261
267
oa = OAS (store_precision = False )
0 commit comments