class sklearn.covariance.OAS(store_precision=True, assume_centered=False)
[source]
Oracle Approximating Shrinkage Estimator
Read more in the User Guide.
OAS is a particular form of shrinkage described in “Shrinkage Algorithms for MMSE Covariance Estimation” Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.
The formula used here does not correspond to the one given in the article. In the original article, formula (23) states that 2/p is multiplied by Trace(cov*cov) in both the numerator and denominator, but this operation is omitted because for a large p, the value of 2/p is so small that it doesn’t affect the value of the estimator.
Parameters: 


Attributes: 

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 OAS formula (see References)
“Shrinkage Algorithms for MMSE Covariance Estimation” Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.
error_norm (comp_cov[, norm, scaling, squared])  Computes the Mean Squared Error between two covariance estimators. 
fit (X[, y])  Fits the Oracle Approximating Shrinkage covariance model according to the given training data and parameters. 
get_params ([deep])  Get parameters for this estimator. 
get_precision ()  Getter for the precision matrix. 
mahalanobis (X)  Computes the squared Mahalanobis distances of given observations. 
score (X_test[, y])  Computes the loglikelihood of a Gaussian data set with self.covariance_ as an estimator of its covariance matrix. 
set_params (**params)  Set the parameters of this estimator. 
__init__(store_precision=True, assume_centered=False)
[source]
error_norm(comp_cov, norm=’frobenius’, scaling=True, squared=True)
[source]
Computes the Mean Squared Error between two covariance estimators. (In the sense of the Frobenius norm).
Parameters: 


Returns: 

fit(X, y=None)
[source]
Fits the Oracle Approximating Shrinkage covariance model according to the given training data and parameters.
Parameters: 


Returns: 

get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: 


Returns: 

get_precision()
[source]
Getter for the precision matrix.
Returns: 


mahalanobis(X)
[source]
Computes the squared Mahalanobis distances of given observations.
Parameters: 


Returns: 

score(X_test, y=None)
[source]
Computes the loglikelihood of a Gaussian data set with self.covariance_
as an estimator of its covariance matrix.
Parameters: 


Returns: 

set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: 


sklearn.covariance.OAS
© 2007–2018 The scikitlearn developers
Licensed under the 3clause BSD License.
http://scikitlearn.org/stable/modules/generated/sklearn.covariance.OAS.html