def get_covariance(self):
    'Compute data covariance with the generative model.\n\n        ``cov = components_.T * S**2 * components_ + sigma2 * eye(n_features)``\n        where S**2 contains the explained variances, and sigma2 contains the\n        noise variances.\n\n        Returns\n        -------\n        cov : array of shape=(n_features, n_features)\n            Estimated covariance of data.\n        '
    components_ = self.components_
    exp_var = self.explained_variance_
    if self.whiten:
        components_ = (components_ * np.sqrt(exp_var[:, np.newaxis]))
    exp_var_diff = np.maximum((exp_var - self.noise_variance_), 0.0)
    cov = np.dot((components_.T * exp_var_diff), components_)
    cov.flat[::(len(cov) + 1)] += self.noise_variance_
    return cov
Compute data covariance with the generative model.

``cov = components_.T * S**2 * components_ + sigma2 * eye(n_features)``
where S**2 contains the explained variances, and sigma2 contains the
noise variances.

Returns
-------
cov : array of shape=(n_features, n_features)
    Estimated covariance of data.
def get_covariance(self):
    'Compute data covariance with the generative model.\n\n        ``cov = components_.T * S**2 * components_ + sigma2 * eye(n_features)``\n        where S**2 contains the explained variances, and sigma2 contains the\n        noise variances.\n\n        Returns\n        -------\n        cov : array of shape=(n_features, n_features)\n            Estimated covariance of data.\n        '
    components_ = self.components_
    exp_var = self.explained_variance_
    if self.whiten:
        components_ = (components_ * np.sqrt(exp_var[:, np.newaxis]))
    exp_var_diff = np.maximum((exp_var - self.noise_variance_), 0.0)
    cov = np.dot((components_.T * exp_var_diff), components_)
    cov.flat[::(len(cov) + 1)] += self.noise_variance_
    return cov