class_docstr: Implementation of the SPoC spatial filtering.
  
  Source Power Comodulation (SPoC) :footcite:`DahneEtAl2014` allows to
  extract spatial filters and
  patterns by using a target (continuous) variable in the decomposition
  process in order to give preference to components whose power correlates
  with the target variable.
  
  SPoC can be seen as an extension of the CSP driven by a continuous
  variable rather than a discrete variable. Typical applications include
  extraction of motor patterns using EMG power or audio patterns using sound
  envelope.
  
  Parameters
  ----------
  n_components : int
      The number of components to decompose M/EEG signals.
  reg : float | str | None (default None)
      If not None (same as ``'empirical'``, default), allow
      regularization for covariance estimation.
      If float, shrinkage is used (0 <= shrinkage <= 1).
      For str options, ``reg`` will be passed to ``method`` to
      :func:`mne.compute_covariance`.
  log : None | bool (default None)
      If transform_into == 'average_power' and log is None or True, then
      applies a log transform to standardize the features, else the features
      are z-scored. If transform_into == 'csp_space', then log must be None.
  transform_into : {'average_power', 'csp_space'}
      If 'average_power' then self.transform will return the average power of
      each spatial filter. If 'csp_space' self.transform will return the data
      in CSP space. Defaults to 'average_power'.
  cov_method_params : dict | None
      Parameters to pass to :func:`mne.compute_covariance`.
  
      .. versionadded:: 0.16
  %(rank_none)s
  
      .. versionadded:: 0.17
  
  Attributes
  ----------
  filters_ : ndarray, shape (n_channels, n_channels)
      If fit, the SPoC spatial filters, else None.
  patterns_ : ndarray, shape (n_channels, n_channels)
      If fit, the SPoC spatial patterns, else None.
  mean_ : ndarray, shape (n_components,)
      If fit, the mean squared power for each component.
  std_ : ndarray, shape (n_components,)
      If fit, the std squared power for each component.
  
  See Also
  --------
  mne.preprocessing.Xdawn, CSP
  
  References
  ----------
  .. footbibliography::
class_docstr_tok: ["Implementation","of","the","SPoC","spatial","filtering",".","Source","Power","Comodulation","(","SPoC",")",":","footcite",":","`","DahneEtAl2014","`","allows","to","extract","spatial","filters","and","patterns","by","using","a","target","(","continuous",")","variable","in","the","decomposition","process","in","order","to","give","preference","to","components","whose","power","correlates","with","the","target","variable",".","SPoC","can","be","seen","as","an","extension","of","the","CSP","driven","by","a","continuous","variable","rather","than","a","discrete","variable",".","Typical","applications","include","extraction","of","motor","patterns","using","EMG","power","or","audio","patterns","using","sound","envelope",".","Parameters","--","--","--","--","--","n_components",":","int","The","number","of","components","to","decompose","M\/EEG","signals",".","reg",":","float","|","str","|","None","(","default","None",")","If","not","None","(","same","as","``","'empirical","'","``",",","default",")",",","allow","regularization","for","covariance","estimation",".","If","float",",","shrinkage","is","used","(","0","<","=","shrinkage","<","=","1",")",".","For","str","options",",","``","reg","``","will","be","passed","to","``","method","``","to",":","func",":","`","mne.compute_covariance","`",".","log",":","None","|","bool","(","default","None",")","If","transform_into","==","'average_power","'","and","log","is","None","or","True",",","then","applies","a","log","transform","to","standardize","the","features",",","else","the","features","are","z-scored",".","If","transform_into","==","'csp_space","'",",","then","log","must","be","None",".","transform_into",":","{","'average_power","'",",","'csp_space","'","}","If","'average_power","'","then","self.transform","will","return","the","average","power","of","each","spatial","filter",".","If","'csp_space","'","self.transform","will","return","the","data","in","CSP","space",".","Defaults","to","'average_power","'",".","cov_method_params",":","dict","|","None","Parameters","to","pass","to",":","func",":","`","mne.compute_covariance","`",".","..","versionadded",":",":","0.16","%","(","rank_none",")","s","..","versionadded",":",":","0.17","Attributes","--","--","--","--","--","filters_",":","ndarray",",","shape","(","n_channels",",","n_channels",")","If","fit",",","the","SPoC","spatial","filters",",","else","None",".","patterns_",":","ndarray",",","shape","(","n_channels",",","n_channels",")","If","fit",",","the","SPoC","spatial","patterns",",","else","None",".","mean_",":","ndarray",",","shape","(","n_components",",",")","If","fit",",","the","mean","squared","power","for","each","component",".","std_",":","ndarray",",","shape","(","n_components",",",")","If","fit",",","the","std","squared","power","for","each","component",".","See","Also","--","--","--","--","mne.preprocessing.Xdawn",",","CSP","References","--","--","--","--","--","..","footbibliography",":",":"]
docstr: Init of SPoC.
docstr_tok: ["Init","of","SPoC","."]
code: def __init__(
      self,
      n_components=4,
      reg=None,
      log=None,
      transform_into="average_power",
      cov_method_params=None,
      rank=None,
  ):
      """Init of SPoC."""
      super().__init__(
          n_components=n_components,
          reg=reg,
          log=log,
          cov_est="epoch",
          norm_trace=False,
          transform_into=transform_into,
          rank=rank,
          cov_method_params=cov_method_params,
      )
      # Covariance estimation have to be done on the single epoch level,
      # unlike CSP where covariance estimation can also be achieved through
      # concatenation of all epochs from the same class.
      delattr(self, "cov_est")
      delattr(self, "norm_trace")
  
imports: import copy
  import numpy
  from scipy.linalg import eigh
  from ..cov import _regularized_covariance
  from ..defaults import _BORDER_DEFAULT, _EXTRAPOLATE_DEFAULT, _INTERPOLATION_DEFAULT
  from ..evoked import EvokedArray
  from ..fixes import pinv
  from ..utils import _check_option, _validate_type, copy_doc, fill_doc
  from .base import BaseEstimator
  from .mixin import TransformerMixin
label_desc: Use image node_id 1 to create a new SPoC object from inherited base classes: CSP with example: obj = SPoC(n_components, reg, log, transform_into, cov_method_params, rank)