class_docstr: Clustering by k-means for each class with SPD matrices as inputs.
  
  See Also
  --------
  Kmeans
docstr: Fit.
docstr_tok: ["Fit","."]
code: def fit(self, X, y):
      """Fit."""
      self.covmeans_ = []
      self.classes_ = np.unique(y)
      for c in self.classes_:
          self.km.fit(X[y == c])
          self.covmeans_.extend(self.km.centroids())
      return self
  
imports: import numpy
  from joblib import Parallel, delayed
  from scipy.stats import norm, chi2
  import sklearn
  from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin, ClusterMixin, clone
  from sklearn.cluster import KMeans
  from .classification import MDM, _check_metric
  from .utils.mean import mean_covariance
  from .utils.geodesic import geodesic
label_desc: Use image node_id 2 for calling the KmeansPerClassTransform obj's underlying member method code with example usage: obj.fit(X, y) and returns: self