MCPcopy
hub / github.com/mne-tools/mne-python / CSP

Class CSP

mne/decoding/csp.py:26–592  ·  view source on GitHub ↗

M/EEG signal decomposition using the Common Spatial Patterns (CSP). This class can be used as a supervised decomposition to estimate spatial filters for feature extraction. CSP in the context of EEG was first described in :footcite:`KolesEtAl1990`; a comprehensive tutorial on CSP can

Source from the content-addressed store, hash-verified

24
25@fill_doc
26class CSP(_GEDTransformer):
27 """M/EEG signal decomposition using the Common Spatial Patterns (CSP).
28
29 This class can be used as a supervised decomposition to estimate spatial
30 filters for feature extraction. CSP in the context of EEG was first
31 described in :footcite:`KolesEtAl1990`; a comprehensive tutorial on CSP can
32 be found in :footcite:`BlankertzEtAl2008`. Multi-class solving is
33 implemented from :footcite:`Grosse-WentrupBuss2008`.
34
35 Parameters
36 ----------
37 n_components : int (default 4)
38 The number of components to decompose M/EEG signals. This number should
39 be set by cross-validation.
40 reg : float | str | None (default None)
41 If not None (same as ``'empirical'``, default), allow regularization
42 for covariance estimation. If float (between 0 and 1), shrinkage is
43 used. For str values, ``reg`` will be passed as ``method`` to
44 :func:`mne.compute_covariance`.
45 log : None | bool (default None)
46 If ``transform_into`` equals ``'average_power'`` and ``log`` is None or
47 True, then apply a log transform to standardize features, else features
48 are z-scored. If ``transform_into`` is ``'csp_space'``, ``log`` must be
49 None.
50 cov_est : 'concat' | 'epoch' (default 'concat')
51 If ``'concat'``, covariance matrices are estimated on concatenated
52 epochs for each class. If ``'epoch'``, covariance matrices are
53 estimated on each epoch separately and then averaged over each class.
54 transform_into : 'average_power' | 'csp_space' (default 'average_power')
55 If 'average_power' then ``self.transform`` will return the average
56 power of each spatial filter. If ``'csp_space'``, ``self.transform``
57 will return the data in CSP space.
58 norm_trace : bool (default False)
59 Normalize class covariance by its trace. Trace normalization is a step
60 of the original CSP algorithm :footcite:`KolesEtAl1990` to eliminate
61 magnitude variations in the EEG between individuals. It is not applied
62 in more recent work :footcite:`BlankertzEtAl2008`,
63 :footcite:`Grosse-WentrupBuss2008` and can have a negative impact on
64 pattern order.
65 cov_method_params : dict | None
66 Parameters to pass to :func:`mne.compute_covariance`.
67
68 .. versionadded:: 0.16
69
70 restr_type : "restricting" | "whitening" | None
71 Restricting transformation for covariance matrices before performing
72 generalized eigendecomposition.
73 If "restricting" only restriction to the principal subspace of signal_cov
74 will be performed.
75 If "whitening", covariance matrices will be additionally rescaled according
76 to the whitening for the signal_cov.
77 If None, no restriction will be applied. Defaults to "restricting".
78
79 .. versionadded:: 1.11
80 info : mne.Info | None
81 The mne.Info object with information about the sensors and methods of
82 measurement used for covariance estimation and generalized
83 eigendecomposition.

Callers 11

test_cspFunction · 0.90
test_regularized_cspFunction · 0.90
test_csp_pipelineFunction · 0.90
test_ssd_pipelineFunction · 0.90
test_spatial_filter_initFunction · 0.90
50_decoding.pyFile · 0.90

Calls

no outgoing calls

Tested by 8

test_cspFunction · 0.72
test_regularized_cspFunction · 0.72
test_csp_pipelineFunction · 0.72
test_ssd_pipelineFunction · 0.72
test_spatial_filter_initFunction · 0.72