class_docstr: Minimum Covariance Determinant (MCD): robust estimator of covariance.
  
  The Minimum Covariance Determinant covariance estimator is to be applied
  on Gaussian-distributed data, but could still be relevant on data
  drawn from a unimodal, symmetric distribution. It is not meant to be used
  with multi-modal data (the algorithm used to fit a MinCovDet object is
  likely to fail in such a case).
  One should consider projection pursuit methods to deal with multi-modal
  datasets.
  
  Read more in the :ref:`User Guide <robust_covariance>`.
  
  Parameters
  ----------
  store_precision : bool
      Specify if the estimated precision is stored.
  
  assume_centered : Boolean
      If True, the support of the robust location and the covariance
      estimates is computed, and a covariance estimate is recomputed from
      it, without centering the data.
      Useful to work with data whose mean is significantly equal to
      zero but is not exactly zero.
      If False, the robust location and covariance are directly computed
      with the FastMCD algorithm without additional treatment.
  
  support_fraction : float, 0 < support_fraction < 1
      The proportion of points to be included in the support of the raw
      MCD estimate. Default is None, which implies that the minimum
      value of support_fraction will be used within the algorithm:
      [n_sample + n_features + 1] / 2
  
  random_state : integer or numpy.RandomState, optional
      The random generator used. If an integer is given, it fixes the
      seed. Defaults to the global numpy random number generator.
  
  Attributes
  ----------
  raw_location_ : array-like, shape (n_features,)
      The raw robust estimated location before correction and re-weighting.
  
  raw_covariance_ : array-like, shape (n_features, n_features)
      The raw robust estimated covariance before correction and re-weighting.
  
  raw_support_ : array-like, shape (n_samples,)
      A mask of the observations that have been used to compute
      the raw robust estimates of location and shape, before correction
      and re-weighting.
  
  location_ : array-like, shape (n_features,)
      Estimated robust location
  
  covariance_ : array-like, shape (n_features, n_features)
      Estimated robust covariance matrix
  
  precision_ : array-like, shape (n_features, n_features)
      Estimated pseudo inverse matrix.
      (stored only if store_precision is True)
  
  support_ : array-like, shape (n_samples,)
      A mask of the observations that have been used to compute
      the robust estimates of location and shape.
  
  dist_ : array-like, shape (n_samples,)
      Mahalanobis distances of the training set (on which `fit` is called)
      observations.
  
  References
  ----------
  
  .. [Rouseeuw1984] `P. J. Rousseeuw. Least median of squares regression.
      J. Am Stat Ass, 79:871, 1984.`
  .. [Rouseeuw1999] `A Fast Algorithm for the Minimum Covariance Determinant
      Estimator, 1999, American Statistical Association and the American
      Society for Quality, TECHNOMETRICS`
  .. [Butler1993] `R. W. Butler, P. L. Davies and M. Jhun,
      Asymptotics For The Minimum Covariance Determinant Estimator,
      The Annals of Statistics, 1993, Vol. 21, No. 3, 1385-1400`
class_docstr_tok: ["Minimum","Covariance","Determinant","(","MCD",")",":","robust","estimator","of","covariance",".","The","Minimum","Covariance","Determinant","covariance","estimator","is","to","be","applied","on","Gaussian-distributed","data",",","but","could","still","be","relevant","on","data","drawn","from","a","unimodal",",","symmetric","distribution",".","It","is","not","meant","to","be","used","with","multi-modal","data","(","the","algorithm","used","to","fit","a","MinCovDet","object","is","likely","to","fail","in","such","a","case",")",".","One","should","consider","projection","pursuit","methods","to","deal","with","multi-modal","datasets",".","Read","more","in","the",":","ref",":","`","User","Guide","<","robust_covariance",">","`",".","Parameters","--","--","--","--","--","store_precision",":","bool","Specify","if","the","estimated","precision","is","stored",".","assume_centered",":","Boolean","If","True",",","the","support","of","the","robust","location","and","the","covariance","estimates","is","computed",",","and","a","covariance","estimate","is","recomputed","from","it",",","without","centering","the","data",".","Useful","to","work","with","data","whose","mean","is","significantly","equal","to","zero","but","is","not","exactly","zero",".","If","False",",","the","robust","location","and","covariance","are","directly","computed","with","the","FastMCD","algorithm","without","additional","treatment",".","support_fraction",":","float",",","0","<","support_fraction","<","1","The","proportion","of","points","to","be","included","in","the","support","of","the","raw","MCD","estimate",".","Default","is","None",",","which","implies","that","the","minimum","value","of","support_fraction","will","be","used","within","the","algorithm",":","[","n_sample","+","n_features","+","1","]","\/","2","random_state",":","integer","or","numpy.RandomState",",","optional","The","random","generator","used",".","If","an","integer","is","given",",","it","fixes","the","seed",".","Defaults","to","the","global","numpy","random","number","generator",".","Attributes","--","--","--","--","--","raw_location_",":","array-like",",","shape","(","n_features",",",")","The","raw","robust","estimated","location","before","correction","and","re-weighting",".","raw_covariance_",":","array-like",",","shape","(","n_features",",","n_features",")","The","raw","robust","estimated","covariance","before","correction","and","re-weighting",".","raw_support_",":","array-like",",","shape","(","n_samples",",",")","A","mask","of","the","observations","that","have","been","used","to","compute","the","raw","robust","estimates","of","location","and","shape",",","before","correction","and","re-weighting",".","location_",":","array-like",",","shape","(","n_features",",",")","Estimated","robust","location","covariance_",":","array-like",",","shape","(","n_features",",","n_features",")","Estimated","robust","covariance","matrix","precision_",":","array-like",",","shape","(","n_features",",","n_features",")","Estimated","pseudo","inverse","matrix",".","(","stored","only","if","store_precision","is","True",")","support_",":","array-like",",","shape","(","n_samples",",",")","A","mask","of","the","observations","that","have","been","used","to","compute","the","robust","estimates","of","location","and","shape",".","dist_",":","array-like",",","shape","(","n_samples",",",")","Mahalanobis","distances","of","the","training","set","(","on","which","`","fit","`","is","called",")","observations",".","References","--","--","--","--","--","..","[","Rouseeuw1984","]","`","P.","J.","Rousseeuw",".","Least","median","of","squares","regression",".","J",".","Am","Stat","Ass",",","79:871",",","1984.","`","..","[","Rouseeuw1999","]","`","A","Fast","Algorithm","for","the","Minimum","Covariance","Determinant","Estimator",",","1999",",","American","Statistical","Association","and","the","American","Society","for","Quality",",","TECHNOMETRICS","`","..","[","Butler1993","]","`","R.","W.","Butler",",","P.","L.","Davies","and","M.","Jhun",",","Asymptotics","For","The","Minimum","Covariance","Determinant","Estimator",",","The","Annals","of","Statistics",",","1993",",","Vol",".","21",",","No",".","3",",","1385-1400","`"]
docstr: Apply a correction to raw Minimum Covariance Determinant estimates.
  
  Correction using the empirical correction factor suggested
  by Rousseeuw and Van Driessen in [Rouseeuw1984]_.
  
  Parameters
  ----------
  data : array-like, shape (n_samples, n_features)
      The data matrix, with p features and n samples.
      The data set must be the one which was used to compute
      the raw estimates.
  
  Returns
  -------
  covariance_corrected : array-like, shape (n_features, n_features)
      Corrected robust covariance estimate.
docstr_tok: ["Apply","a","correction","to","raw","Minimum","Covariance","Determinant","estimates",".","Correction","using","the","empirical","correction","factor","suggested","by","Rousseeuw","and","Van","Driessen","in","[","Rouseeuw1984","]","_.","Parameters","--","--","--","--","--","data",":","array-like",",","shape","(","n_samples",",","n_features",")","The","data","matrix",",","with","p","features","and","n","samples",".","The","data","set","must","be","the","one","which","was","used","to","compute","the","raw","estimates",".","Returns","--","--","--","-","covariance_corrected",":","array-like",",","shape","(","n_features",",","n_features",")","Corrected","robust","covariance","estimate","."]
code: def correct_covariance(self, data):
      """Apply a correction to raw Minimum Covariance Determinant estimates.
  
      Correction using the empirical correction factor suggested
      by Rousseeuw and Van Driessen in [Rouseeuw1984]_.
  
      Parameters
      ----------
      data : array-like, shape (n_samples, n_features)
          The data matrix, with p features and n samples.
          The data set must be the one which was used to compute
          the raw estimates.
  
      Returns
      -------
      covariance_corrected : array-like, shape (n_features, n_features)
          Corrected robust covariance estimate.
  
      """
      correction = np.median(self.dist_) / chi2(data.shape[1]).isf(0.5)
      covariance_corrected = self.raw_covariance_ * correction
      self.dist_ /= correction
      return covariance_corrected
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/covariance/robust_covariance.py
imports: import warnings
  import numbers
  import numpy
  from scipy import linalg
  from scipy.stats import chi2
  from .None import empirical_covariance, EmpiricalCovariance
  from ..utils.extmath import fast_logdet, pinvh
  from ..utils import check_random_state, check_array
label_desc: Use image node_id 3 for calling the MinCovDet obj's underlying member method code with example usage: obj.correct_covariance(data) and returns: covariance_corrected