Warning: This documentation is for scikits.learn version 0.6.0. — Latest stable version

Contents

6.9.2. scikits.learn.covariance.ShrunkCovariance

class scikits.learn.covariance.ShrunkCovariance(store_covariance=True, shrinkage=None)

Covariance estimator with shrinkage

Parameters :

store_covariance : bool

Specify if the estimated covariance is stored

shrinkage : float

Shrinkage (in [0, 1])

Notes

The regularized covariance is given by

(1 - shrinkage)*cov
  • shrinkage*mu*np.identity(n_features)

where mu = trace(cov) / n_features

Attributes

covariance_ 2D ndarray, shape (n_features, n_features) Estimated covariance matrix (stored only is store_covariance is True)
precision_ 2D ndarray, shape (n_features, n_features) Estimated precision matrix

Methods

fit(X, **params)
log_likelihood(test_cov)
score(X_test)
__init__(store_covariance=True, shrinkage=None)