@@ -240,17 +240,15 @@ def ledoit_wolf(X, assume_centered=False, block_size=1000):
240
240
X : array-like, shape (n_samples, n_features)
241
241
Data from which to compute the covariance estimate
242
242
243
- assume_centered : Boolean
243
+ assume_centered : boolean, default=False
244
244
If True, data are not centered before computation.
245
245
Useful to work with data whose mean is significantly equal to
246
246
zero but is not exactly zero.
247
247
If False, data are centered before computation.
248
248
249
- block_size : int,
249
+ block_size : int, default=1000
250
250
Size of the blocks into which the covariance matrix will be split.
251
- If n_features > `block_size`, an error will be raised since the
252
- shrunk covariance matrix will be considered as too large regarding
253
- the available memory.
251
+ This is purely a memory optimization and does not affect results.
254
252
255
253
Returns
256
254
-------
@@ -286,10 +284,6 @@ def ledoit_wolf(X, assume_centered=False, block_size=1000):
286
284
else :
287
285
n_samples , n_features = X .shape
288
286
289
- if n_features > block_size :
290
- raise MemoryError ("LW: n_features is too large, " +
291
- "try increasing block_size" )
292
-
293
287
# get Ledoit-Wolf shrinkage
294
288
shrinkage = ledoit_wolf_shrinkage (
295
289
X , assume_centered = assume_centered , block_size = block_size )
@@ -312,21 +306,19 @@ class LedoitWolf(EmpiricalCovariance):
312
306
313
307
Parameters
314
308
----------
315
- store_precision : bool
309
+ store_precision : bool, default=True
316
310
Specify if the estimated precision is stored.
317
311
318
- assume_centered : bool
312
+ assume_centered : bool, default=False
319
313
If True, data are not centered before computation.
320
314
Useful when working with data whose mean is almost, but not exactly
321
315
zero.
322
316
If False (default), data are centered before computation.
323
317
324
- block_size : int,
318
+ block_size : int, default=1000
325
319
Size of the blocks into which the covariance matrix will be split
326
- during its Ledoit-Wolf estimation.
327
- If n_features > `block_size`, an error will be raised since the
328
- shrunk covariance matrix will be considered as too large regarding
329
- the available memory.
320
+ during its Ledoit-Wolf estimation. This is purely a memory
321
+ optimization and does not affect results.
330
322
331
323
Attributes
332
324
----------
@@ -480,10 +472,10 @@ class OAS(EmpiricalCovariance):
480
472
481
473
Parameters
482
474
----------
483
- store_precision : bool
475
+ store_precision : bool, default=True
484
476
Specify if the estimated precision is stored.
485
477
486
- assume_centered: bool
478
+ assume_centered: bool, default=False
487
479
If True, data are not centered before computation.
488
480
Useful when working with data whose mean is almost, but not exactly
489
481
zero.
0 commit comments