sklearn.covariance.shrunk_covariance(emp_cov, shrinkage=0.1)
[source]
Calculates a covariance matrix shrunk on the diagonal
Read more in the User Guide.
Parameters: |
|
---|---|
Returns: |
|
The regularized (shrunk) covariance is given by:
(1 - shrinkage) * cov + shrinkage * mu * np.identity(n_features)
where mu = trace(cov) / n_features
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.covariance.shrunk_covariance.html