class_docstr: Estimation of kernel matrix between channels of time series.
  
  Perform a kernel matrix estimation for each given time series, evaluating a
  kernel function between each pair of channels (rather than between pairs of
  time samples) and allowing to extract nonlinear channel relationship [1]_.
  
  For an input time series :math:`X \in \mathbb{R}^{c \times t}`, composed of
  :math:`c` channels and :math:`t` time samples, kernel function
  :math:`\kappa()` is computed between channels :math:`i` and :math:`j`:
  
  .. math::
      K_{i,j} = \kappa \left( X[i], X[j] \right)
  
  Linear kernel is related to :class:`pyriemann.estimation.Covariances` [1]_,
  but this class allows to generalize to nonlinear relationships.
  
  Parameters
  ----------
  metric : string, default='linear'
      The metric to use when computing kernel function between channels [2]_:
      'linear', 'poly', 'polynomial', 'rbf', 'laplacian', 'cosine'.
  n_jobs : int, default=None
      The number of jobs to use for the computation [2]_. This works by
      breaking down the pairwise matrix into n_jobs even slices and computing
      them in parallel.
  **kwds : dict
      Any further parameters are passed directly to the kernel function [2]_.
  
  See Also
  --------
  Covariances
  
  Notes
  -----
  .. versionadded:: 0.4
  
  References
  ----------
  .. [1] `Beyond Covariance: Feature Representation with Nonlinear Kernel
      Matrices
      <https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/Wang_Beyond_Covariance_Feature_ICCV_2015_paper.pdf>`_
      L. Wang, J. Zhang, L. Zhou, C. Tang, W Li. ICCV, 2015.
  .. [2]
      https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.pairwise_kernels.html
docstr: Estimate kernel matrices from time series.
  
  Parameters
  ----------
  X : ndarray, shape (n_matrices, n_channels, n_times)
      Multi-channel time-series.
  
  Returns
  -------
  K : ndarray, shape (n_matrices, n_channels, n_channels)
      Kernel matrices.
docstr_tok: ["Estimate","kernel","matrices","from","time","series",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_times",")","Multi-channel","time-series",".","Returns","--","--","--","-","K",":","ndarray",",","shape","(","n_matrices",",","n_channels",",","n_channels",")","Kernel","matrices","."]
code: def transform(self, X):
      """Estimate kernel matrices from time series.
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_times)
          Multi-channel time-series.
  
      Returns
      -------
      K : ndarray, shape (n_matrices, n_channels, n_channels)
          Kernel matrices.
      """
      if self.metric not in [
          "linear",
          "poly",
          "polynomial",
          "rbf",
          "laplacian",
          "cosine",
      ]:
          raise TypeError("Unsupported metric for kernel estimation.")
  
      K = [
          pairwise_kernels(
              x,
              None,
              metric=self.metric,
              n_jobs=self.n_jobs,
              **self.kwds,
          )
          for x in X
      ]
  
      return np.asarray(K)
  
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 Kernels obj's underlying member method code with example usage: obj.transform(X) and returns: np