class_docstr: Artefact detection with the Riemannian Potato.
  
  The Riemannian Potato [1]_ is a clustering method used to detect artifact
  in EEG signals. The algorithm iteratively estimates the centroid of clean
  signal by rejecting every trial that is too far from it.
  
  Parameters
  ----------
  metric : string, default='riemann'
      The type of metric used for centroid and distance estimation.
  threshold : float, default=3
      Threshold on z-score of distance to reject artifacts. It is the number
      of standard deviations from the mean of distances to the centroid.
  n_iter_max : int, default=100
      The maximum number of iteration to reach convergence.
  pos_label : int, default=1
      The positive label corresponding to clean data.
  neg_label : int, default=0
      The negative label corresponding to artifact data.
  
  Notes
  -----
  .. versionadded:: 0.2.3
  
  Attributes
  ----------
  covmean_ : ndarray, shape (n_channels, n_channels)
      Centroid of potato.
  
  See Also
  --------
  Kmeans
  MDM
  
  References
  ----------
  .. [1] `The Riemannian Potato: an automatic and adaptive artifact detection
      method for online experiments using Riemannian geometry
      <https://hal.archives-ouvertes.fr/hal-00781701>`_
      A. Barachant, A Andreev, and M. Congedo. TOBI Workshop lV, Jan 2013,
      Sion, Switzerland. pp.19-20.
  .. [2] `The Riemannian Potato Field: A Tool for Online Signal Quality Index
      of EEG
      <https://hal.archives-ouvertes.fr/hal-02015909>`_
      Q. Barthélemy, L. Mayaud, D. Ojeda, and M. Congedo. IEEE Transactions
      on Neural Systems and Rehabilitation Engineering, IEEE Institute of
      Electrical and Electronics Engineers, 2019, 27 (2), pp.244-255
docstr: Return the normalized log-distance to the centroid (z-score).
  
  Parameters
  ----------
  X : ndarray, shape (n_matrices, n_channels, n_channels)
      Set of SPD matrices.
  
  Returns
  -------
  z : ndarray, shape (n_matrices,)
      the normalized log-distance to the centroid.
docstr_tok: ["Return","the","normalized","log-distance","to","the","centroid","(","z-score",")",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_channels",")","Set","of","SPD","matrices",".","Returns","--","--","--","-","z",":","ndarray",",","shape","(","n_matrices",",",")","the","normalized","log-distance","to","the","centroid","."]
code: def transform(self, X):
      """Return the normalized log-distance to the centroid (z-score).
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_channels)
          Set of SPD matrices.
  
      Returns
      -------
      z : ndarray, shape (n_matrices,)
          the normalized log-distance to the centroid.
      """
      d = np.squeeze(np.log(self._mdm.transform(X)), axis=1)
      z = self._get_z_score(d)
      return z
  
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 4 for calling the Potato obj's underlying member method code with example usage: obj.transform(X) and returns: z