class_docstr: Base class for PCA methods.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
docstr: 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 : Tensor, shape=(n_features, n_features)
      Estimated covariance of data.
docstr_tok: ["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",":","Tensor",",","shape=","(","n_features",",","n_features",")","Estimated","covariance","of","data","."]
code: def get_covariance(self, session=None):
      """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 : Tensor, shape=(n_features, n_features)
          Estimated covariance of data.
      """
      components_ = self.components_
      exp_var = self.explained_variance_
      if self.whiten:
          components_ = components_ * mt.sqrt(exp_var[:, mt.newaxis])
      exp_var_diff = mt.maximum(exp_var - self.noise_variance_, 0.0)
      cov = mt.dot(components_.T * exp_var_diff, components_)
      cov.flat[
          :: len(cov) + 1
      ] += self.noise_variance_  # modify diag inplace
      cov.execute(session=session)
      return cov
  
file_path: mars/mars/learn/decomposition/_base.py
imports: from abc import ABCMeta, abstractmethod
  from sklearn.base import BaseEstimator, TransformerMixin
  from ...None import tensor
  from ...tensor import linalg
  from ..utils import check_array
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 1 for calling the _BasePCA obj's underlying member method code with example usage: obj.get_covariance(session) and returns: cov