class_docstr: LedoitWolf Estimator.
  
  Ledoit-Wolf is a particular form of shrinkage, where the shrinkage
  coefficient is computed using O. Ledoit and M. Wolf's formula as
  described in "A Well-Conditioned Estimator for Large-Dimensional
  Covariance Matrices", Ledoit and Wolf, Journal of Multivariate
  Analysis, Volume 88, Issue 2, February 2004, pages 365-411.
  
  Read more in the :ref:`User Guide <shrunk_covariance>`.
  
  Parameters
  ----------
  store_precision : bool, default=True
      Specify if the estimated precision is stored.
  
  assume_centered : bool, default=False
      If True, data will not be centered before computation.
      Useful when working with data whose mean is almost, but not exactly
      zero.
      If False (default), data will be centered before computation.
  
  block_size : int, default=1000
      Size of blocks into which the covariance matrix will be split
      during its Ledoit-Wolf estimation. This is purely a memory
      optimization and does not affect results.
  
  Attributes
  ----------
  covariance_ : ndarray of shape (n_features, n_features)
      Estimated covariance matrix.
  
  location_ : ndarray of shape (n_features,)
      Estimated location, i.e. the estimated mean.
  
  precision_ : ndarray of shape (n_features, n_features)
      Estimated pseudo inverse matrix.
      (stored only if store_precision is True)
  
  shrinkage_ : float
      Coefficient in the convex combination used for the computation
      of the shrunk estimate. Range is [0, 1].
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  EllipticEnvelope : An object for detecting outliers in
      a Gaussian distributed dataset.
  EmpiricalCovariance : Maximum likelihood covariance estimator.
  GraphicalLasso : Sparse inverse covariance estimation
      with an l1-penalized estimator.
  GraphicalLassoCV : Sparse inverse covariance with cross-validated
      choice of the l1 penalty.
  MinCovDet : Minimum Covariance Determinant
      (robust estimator of covariance).
  OAS : Oracle Approximating Shrinkage Estimator.
  ShrunkCovariance : Covariance estimator with shrinkage.
  
  Notes
  -----
  The regularised covariance is:
  
  (1 - shrinkage) * cov + shrinkage * mu * np.identity(n_features)
  
  where mu = trace(cov) / n_features
  and shrinkage is given by the Ledoit and Wolf formula (see References)
  
  References
  ----------
  "A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices",
  Ledoit and Wolf, Journal of Multivariate Analysis, Volume 88, Issue 2,
  February 2004, pages 365-411.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.covariance import LedoitWolf
  >>> real_cov = np.array([[.4, .2],
  ...                      [.2, .8]])
  >>> np.random.seed(0)
  >>> X = np.random.multivariate_normal(mean=[0, 0],
  ...                                   cov=real_cov,
  ...                                   size=50)
  >>> cov = LedoitWolf().fit(X)
  >>> cov.covariance_
  array([[0.4406..., 0.1616...],
         [0.1616..., 0.8022...]])
  >>> cov.location_
  array([ 0.0595... , -0.0075...])
class_docstr_tok: ["LedoitWolf","Estimator",".","Ledoit-Wolf","is","a","particular","form","of","shrinkage",",","where","the","shrinkage","coefficient","is","computed","using","O.","Ledoit","and","M.","Wolf","'s","formula","as","described","in","``","A","Well-Conditioned","Estimator","for","Large-Dimensional","Covariance","Matrices","''",",","Ledoit","and","Wolf",",","Journal","of","Multivariate","Analysis",",","Volume","88",",","Issue","2",",","February","2004",",","pages","365-411",".","Read","more","in","the",":","ref",":","`","User","Guide","<","shrunk_covariance",">","`",".","Parameters","--","--","--","--","--","store_precision",":","bool",",","default=True","Specify","if","the","estimated","precision","is","stored",".","assume_centered",":","bool",",","default=False","If","True",",","data","will","not","be","centered","before","computation",".","Useful","when","working","with","data","whose","mean","is","almost",",","but","not","exactly","zero",".","If","False","(","default",")",",","data","will","be","centered","before","computation",".","block_size",":","int",",","default=1000","Size","of","blocks","into","which","the","covariance","matrix","will","be","split","during","its","Ledoit-Wolf","estimation",".","This","is","purely","a","memory","optimization","and","does","not","affect","results",".","Attributes","--","--","--","--","--","covariance_",":","ndarray","of","shape","(","n_features",",","n_features",")","Estimated","covariance","matrix",".","location_",":","ndarray","of","shape","(","n_features",",",")","Estimated","location",",","i.e",".","the","estimated","mean",".","precision_",":","ndarray","of","shape","(","n_features",",","n_features",")","Estimated","pseudo","inverse","matrix",".","(","stored","only","if","store_precision","is","True",")","shrinkage_",":","float","Coefficient","in","the","convex","combination","used","for","the","computation","of","the","shrunk","estimate",".","Range","is","[","0",",","1","]",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","EllipticEnvelope",":","An","object","for","detecting","outliers","in","a","Gaussian","distributed","dataset",".","EmpiricalCovariance",":","Maximum","likelihood","covariance","estimator",".","GraphicalLasso",":","Sparse","inverse","covariance","estimation","with","an","l1-penalized","estimator",".","GraphicalLassoCV",":","Sparse","inverse","covariance","with","cross-validated","choice","of","the","l1","penalty",".","MinCovDet",":","Minimum","Covariance","Determinant","(","robust","estimator","of","covariance",")",".","OAS",":","Oracle","Approximating","Shrinkage","Estimator",".","ShrunkCovariance",":","Covariance","estimator","with","shrinkage",".","Notes","--","--","-","The","regularised","covariance","is",":","(","1","-","shrinkage",")","*","cov","+","shrinkage","*","mu","*","np.identity","(","n_features",")","where","mu","=","trace","(","cov",")","\/","n_features","and","shrinkage","is","given","by","the","Ledoit","and","Wolf","formula","(","see","References",")","References","--","--","--","--","--","''","A","Well-Conditioned","Estimator","for","Large-Dimensional","Covariance","Matrices","''",",","Ledoit","and","Wolf",",","Journal","of","Multivariate","Analysis",",","Volume","88",",","Issue","2",",","February","2004",",","pages","365-411",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.covariance","import","LedoitWolf",">",">",">","real_cov","=","np.array","(","[","[",".4",",",".2","]",",","...","[",".2",",",".8","]","]",")",">",">",">","np.random.seed","(","0",")",">",">",">","X","=","np.random.multivariate_normal","(","mean=","[","0",",","0","]",",","...","cov=real_cov",",","...","size=50",")",">",">",">","cov","=","LedoitWolf","(",")",".fit","(","X",")",">",">",">","cov.covariance_","array","(","[","[","0.4406","...",",","0.1616","...","]",",","[","0.1616","...",",","0.8022","...","]","]",")",">",">",">","cov.location_","array","(","[","0.0595","...",",","-0.0075","...","]",")"]
code: def __init__(
      self,
      *,
      store_precision=True,
      assume_centered=False,
      block_size=1000,
  ):
      super().__init__(
          store_precision=store_precision,
          assume_centered=assume_centered,
      )
      self.block_size = block_size
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from ..base import _fit_context
  from ..utils import check_array
  from ..utils._param_validation import Interval, validate_params
  from .None import EmpiricalCovariance, empirical_covariance
label_desc: Use image node_id 1 to create a new LedoitWolf object from inherited base classes: EmpiricalCovariance with example: obj = LedoitWolf()