class_docstr: Estimate special form covariance matrix for ERP combined with Xdawn.
  
  Estimation of special form covariance matrix dedicated to ERP processing
  combined with `Xdawn` spatial filtering.
  This is similar to :class:`pyriemann.estimation.ERPCovariances` but data
  are spatially filtered with :class:`pyriemann.spatialfilters.Xdawn`.
  A complete description of the method is available in [1]_.
  
  The advantage of this estimation is to reduce dimensionality of the
  covariance matrices supervisely.
  
  Parameters
  ----------
  nfilter : int, default=4
      Number of Xdawn filters per class.
  applyfilters : bool, default=True
      If set to true, spatial filter are applied to the prototypes and the
      signals. When set to False, filters are applied only to the ERP
      prototypes allowing for a better generalization across subject and
      session at the expense of dimensionality increase. In that case, the
      estimation is similar to :class:`pyriemann.estimation.ERPCovariances`
      with `svd=nfilter` but with more compact prototype reduction.
  classes : list of int | None, default=None
      list of classes to take into account for prototype estimation.
      If None, all classes will be accounted.
  estimator : string, default='scm'
      Covariance matrix estimator, see
      :func:`pyriemann.utils.covariance.covariances`.
  xdawn_estimator : string, default='scm'
      Covariance matrix estimator for `Xdawn` spatial filtering.
      Should be regularized using 'lwf' or 'oas', see
      :func:`pyriemann.utils.covariance.covariances`.
  baseline_cov : array, shape (n_channels, n_channels) | None, default=None
      Baseline covariance for `Xdawn` spatial filtering,
      see :class:`pyriemann.spatialfilters.Xdawn`.
  **kwds : dict
      Any further parameters are passed directly to the covariance estimator.
  
  Attributes
  ----------
  P_ : ndarray, shape (n_classes x min(n_channels, n_filters), n_times)
      If fit, the evoked response for each event type, concatenated.
  
  See Also
  --------
  ERPCovariances
  Xdawn
  
  References
  ----------
  .. [1] `MEG decoding using Riemannian Geometry and
      Unsupervised classification
      <https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.713.5131>`_
      A. Barachant. Technical report with the solution of the DecMeg 2014
      challenge.
docstr: Estimate Xdawn covariance matrices.
  
  Parameters
  ----------
  X : ndarray, shape (n_matrices, n_channels, n_times)
      Multi-channel time-series.
  
  Returns
  -------
  covmats : ndarray, shape (n_matrices, n_components, n_components)
      Covariance matrices filtered by Xdawn, where n_components is equal
      to `2 x n_classes x min(n_channels, nfilter)` if `applyfilters` is
      True, and to `n_channels + n_classes x min(n_channels, nfilter)`
      otherwise.
docstr_tok: ["Estimate","Xdawn","covariance","matrices",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_times",")","Multi-channel","time-series",".","Returns","--","--","--","-","covmats",":","ndarray",",","shape","(","n_matrices",",","n_components",",","n_components",")","Covariance","matrices","filtered","by","Xdawn",",","where","n_components","is","equal","to","`","2","x","n_classes","x","min","(","n_channels",",","nfilter",")","`","if","`","applyfilters","`","is","True",",","and","to","`","n_channels","+","n_classes","x","min","(","n_channels",",","nfilter",")","`","otherwise","."]
code: def transform(self, X):
      """Estimate Xdawn covariance matrices.
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_times)
          Multi-channel time-series.
  
      Returns
      -------
      covmats : ndarray, shape (n_matrices, n_components, n_components)
          Covariance matrices filtered by Xdawn, where n_components is equal
          to `2 x n_classes x min(n_channels, nfilter)` if `applyfilters` is
          True, and to `n_channels + n_classes x min(n_channels, nfilter)`
          otherwise.
      """
      if self.applyfilters:
          X = self.Xd_.transform(X)
  
      covmats = covariances_EP(
          X, self.P_, estimator=self.estimator, **self.kwds
      )
      return covmats
  
imports: import numpy
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.covariance import shrunk_covariance
  from sklearn.metrics.pairwise import pairwise_kernels
  from .spatialfilters import Xdawn
  from .utils.covariance import covariances, covariances_EP, cospectrum, coherence, block_covariances
label_desc: Use image node_id 3 for calling the XdawnCovariances obj's underlying member method code with example usage: obj.transform(X) and returns: covmats