class_docstr: Classification by Minimum Distance to Mean.
  
  Classification by nearest centroid. For each of the given classes, a
  centroid is estimated according to the chosen metric. Then, for each new
  point, the class is affected according to the nearest centroid.
  
  Parameters
  ----------
  metric : string | dict, default='riemann'
      The type of metric used for centroid and distance estimation.
      see `mean_covariance` for the list of supported metric.
      the metric could be a dict with two keys, `mean` and `distance` in
      order to pass different metrics for the centroid estimation and the
      distance estimation. Typical usecase is to pass 'logeuclid' metric for
      the mean in order to boost the computional speed and 'riemann' for the
      distance in order to keep the good sensitivity for the classification.
  n_jobs : int, default=1
      The number of jobs to use for the computation. This works by computing
      each of the class centroid in parallel.
      If -1 all CPUs are used. If 1 is given, no parallel computing code is
      used at all, which is useful for debugging. For n_jobs below -1,
      (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one
      are used.
  
  Attributes
  ----------
  classes_ : ndarray, shape (n_classes,)
      Labels for each class.
  covmeans_ : list of ``n_classes`` ndarrays of shape (n_channels,             n_channels)
      Centroids for each class.
  
  See Also
  --------
  Kmeans
  FgMDM
  KNearestNeighbor
  
  References
  ----------
  .. [1] `Multiclass Brain-Computer Interface Classification by Riemannian
      Geometry
      <https://hal.archives-ouvertes.fr/hal-00681328>`_
      A. Barachant, S. Bonnet, M. Congedo, and C. Jutten. IEEE Transactions
      on Biomedical Engineering, vol. 59, no. 4, p. 920-928, 2012.
  .. [2] `Riemannian geometry applied to BCI classification
      <https://hal.archives-ouvertes.fr/hal-00602700/>`_
      A. Barachant, S. Bonnet, M. Congedo and C. Jutten. 9th International
      Conference Latent Variable Analysis and Signal Separation
      (LVA/ICA 2010), LNCS vol. 6365, 2010, p. 629-636.
class_docstr_tok: ["Classification","by","Minimum","Distance","to","Mean",".","Classification","by","nearest","centroid",".","For","each","of","the","given","classes",",","a","centroid","is","estimated","according","to","the","chosen","metric",".","Then",",","for","each","new","point",",","the","class","is","affected","according","to","the","nearest","centroid",".","Parameters","--","--","--","--","--","metric",":","string","|","dict",",","default='riemann'","The","type","of","metric","used","for","centroid","and","distance","estimation",".","see","`","mean_covariance","`","for","the","list","of","supported","metric",".","the","metric","could","be","a","dict","with","two","keys",",","`","mean","`","and","`","distance","`","in","order","to","pass","different","metrics","for","the","centroid","estimation","and","the","distance","estimation",".","Typical","usecase","is","to","pass","'logeuclid","'","metric","for","the","mean","in","order","to","boost","the","computional","speed","and","'riemann","'","for","the","distance","in","order","to","keep","the","good","sensitivity","for","the","classification",".","n_jobs",":","int",",","default=1","The","number","of","jobs","to","use","for","the","computation",".","This","works","by","computing","each","of","the","class","centroid","in","parallel",".","If","-1","all","CPUs","are","used",".","If","1","is","given",",","no","parallel","computing","code","is","used","at","all",",","which","is","useful","for","debugging",".","For","n_jobs","below","-1",",","(","n_cpus","+","1","+","n_jobs",")","are","used",".","Thus","for","n_jobs","=","-2",",","all","CPUs","but","one","are","used",".","Attributes","--","--","--","--","--","classes_",":","ndarray",",","shape","(","n_classes",",",")","Labels","for","each","class",".","covmeans_",":","list","of","``","n_classes","``","ndarrays","of","shape","(","n_channels",",","n_channels",")","Centroids","for","each","class",".","See","Also","--","--","--","--","Kmeans","FgMDM","KNearestNeighbor","References","--","--","--","--","--","..","[","1","]","`","Multiclass","Brain-Computer","Interface","Classification","by","Riemannian","Geometry","<","https",":","\/\/hal.archives-ouvertes.fr\/hal-00681328",">","`","_","A.","Barachant",",","S.","Bonnet",",","M.","Congedo",",","and","C.","Jutten",".","IEEE","Transactions","on","Biomedical","Engineering",",","vol",".","59",",","no",".","4",",","p.","920-928",",","2012",".","..","[","2","]","`","Riemannian","geometry","applied","to","BCI","classification","<","https",":","\/\/hal.archives-ouvertes.fr\/hal-00602700\/",">","`","_","A.","Barachant",",","S.","Bonnet",",","M.","Congedo","and","C.","Jutten",".","9th","International","Conference","Latent","Variable","Analysis","and","Signal","Separation","(","LVA\/ICA","2010",")",",","LNCS","vol",".","6365",",","2010",",","p.","629-636","."]
docstr: Get the distance to each centroid.
  
  Parameters
  ----------
  X : ndarray, shape (n_matrices, n_channels, n_channels)
      Set of SPD matrices.
  
  Returns
  -------
  dist : ndarray, shape (n_matrices, n_classes)
      The distance to each centroid according to the metric.
docstr_tok: ["Get","the","distance","to","each","centroid",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_channels",")","Set","of","SPD","matrices",".","Returns","--","--","--","-","dist",":","ndarray",",","shape","(","n_matrices",",","n_classes",")","The","distance","to","each","centroid","according","to","the","metric","."]
code: def transform(self, X):
      """Get the distance to each centroid.
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_channels)
          Set of SPD matrices.
  
      Returns
      -------
      dist : ndarray, shape (n_matrices, n_classes)
          The distance to each centroid according to the metric.
      """
      return self._predict_distances(X)
  
imports: import functools
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
  from sklearn.svm import SVC
  from sklearn.utils.extmath import softmax
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import make_pipeline
  from joblib import Parallel, delayed
  import warnings
  from .utils.kernel import kernel
  from .utils.mean import mean_covariance, mean_power
  from .utils.distance import distance
  from .tangentspace import FGDA, TangentSpace
label_desc: Use image node_id 5 for calling the MDM obj's underlying member method code with example usage: obj.transform(X) and returns: self