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: Partially fit the potato from covariance matrices.
  
  This partial fit can be used to update dynamic or semi-dymanic online
  potatoes with clean EEG.
  
  Parameters
  ----------
  X : ndarray, shape (n_matrices, n_channels, n_channels)
      Set of SPD matrices.
  y : None | ndarray, shape (n_matrices,), default=None
      Labels corresponding to each matrix: positive (resp. negative)
      label corresponds to a clean (resp. artifact) matrix.
      If None, all matrices are considered as clean.
  alpha : float, default=0.1
      Update rate in [0, 1] for the centroid, and mean and standard
      deviation of log-distances: 0 for no update, 1 for full update.
  
  Returns
  -------
  self : Potato instance
      The Potato instance.
docstr_tok: ["Partially","fit","the","potato","from","covariance","matrices",".","This","partial","fit","can","be","used","to","update","dynamic","or","semi-dymanic","online","potatoes","with","clean","EEG",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_channels",")","Set","of","SPD","matrices",".","y",":","None","|","ndarray",",","shape","(","n_matrices",",",")",",","default=None","Labels","corresponding","to","each","matrix",":","positive","(","resp",".","negative",")","label","corresponds","to","a","clean","(","resp",".","artifact",")","matrix",".","If","None",",","all","matrices","are","considered","as","clean",".","alpha",":","float",",","default=0.1","Update","rate","in","[","0",",","1","]","for","the","centroid",",","and","mean","and","standard","deviation","of","log-distances",":","0","for","no","update",",","1","for","full","update",".","Returns","--","--","--","-","self",":","Potato","instance","The","Potato","instance","."]
code: def partial_fit(self, X, y=None, alpha=0.1):
      """Partially fit the potato from covariance matrices.
  
      This partial fit can be used to update dynamic or semi-dymanic online
      potatoes with clean EEG.
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_channels)
          Set of SPD matrices.
      y : None | ndarray, shape (n_matrices,), default=None
          Labels corresponding to each matrix: positive (resp. negative)
          label corresponds to a clean (resp. artifact) matrix.
          If None, all matrices are considered as clean.
      alpha : float, default=0.1
          Update rate in [0, 1] for the centroid, and mean and standard
          deviation of log-distances: 0 for no update, 1 for full update.
  
      Returns
      -------
      self : Potato instance
          The Potato instance.
      """
      if not hasattr(self, "_mdm"):
          raise ValueError(
              "Partial fit can be called only on an already fitted potato."
          )
  
      n_matrices, n_channels, _ = X.shape
      if n_channels != self._mdm.covmeans_[0].shape[0]:
          raise ValueError(
              "X does not have the good number of channels. Should be %d but"
              " got %d." % (self._mdm.covmeans_[0].shape[0], n_channels)
          )
  
      y = self._check_labels(X, y)
  
      if not 0 <= alpha <= 1:
          raise ValueError("Parameter alpha must be in [0, 1]")
  
      if alpha > 0:
          if n_matrices > 1:  # mini-batch update
              Xm = mean_covariance(
                  X[(y == self.pos_label)], metric=self.metric
              )
          else:  # pure online update
              Xm = X[0]
          self._mdm.covmeans_[0] = geodesic(
              self._mdm.covmeans_[0], Xm, alpha, metric=self.metric
          )
  
          d = np.squeeze(
              np.log(self._mdm.transform(Xm[np.newaxis, ...]))
          )
          self._mean = (1 - alpha) * self._mean + alpha * d
          self._std = np.sqrt(
              (1 - alpha) * self._std**2
              + alpha * (d - self._mean) ** 2
          )
  
      self.covmean_ = self._mdm.covmeans_[0]
      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 3 for calling the Potato obj's underlying member method code with example usage: obj.partial_fit(X, y, alpha) and returns: self