mne.decoding.
CSP
(n_components=4, reg=None, log=None, cov_est='concat', transform_into='average_power', norm_trace=False, cov_method_params=None)[source]¶M/EEG signal decomposition using the Common Spatial Patterns (CSP).
This object can be used as a supervised decomposition to estimate spatial filters for feature extraction in a 2 class decoding problem. CSP in the context of EEG was first described in [1]; a comprehensive tutorial on CSP can be found in [2]. Multiclass solving is implemented from [3].
Parameters: |
|
---|
See also
References
[1] | (1, 2) Zoltan J. Koles, Michael S. Lazar, Steven Z. Zhou. Spatial Patterns Underlying Population Differences in the Background EEG. Brain Topography 2(4), 275-284, 1990. |
[2] | (1, 2) Benjamin Blankertz, Ryota Tomioka, Steven Lemm, Motoaki Kawanabe, Klaus-Robert Müller. Optimizing Spatial Filters for Robust EEG Single-Trial Analysis. IEEE Signal Processing Magazine 25(1), 41-56, 2008. |
[3] | (1, 2) Grosse-Wentrup, Moritz, and Martin Buss. Multiclass common spatial patterns and information theoretic feature extraction. IEEE Transactions on Biomedical Engineering, Vol 55, no. 8, 2008. |
Attributes: |
|
---|
Methods
__hash__ ($self, /) |
Return hash(self). |
fit (X, y) |
Estimate the CSP decomposition on epochs. |
fit_transform (X[, y]) |
Fit to data, then transform it. |
get_params ([deep]) |
Get parameters for this estimator. |
plot_filters (info[, components, ch_type, …]) |
Plot topographic filters of components. |
plot_patterns (info[, components, ch_type, …]) |
Plot topographic patterns of components. |
set_params (**params) |
Set the parameters of this estimator. |
transform (X) |
Estimate epochs sources given the CSP filters. |
__hash__
($self, /)¶Return hash(self).
fit
(X, y)[source]¶Estimate the CSP decomposition on epochs.
Parameters: |
|
---|---|
Returns: |
|
fit_transform
(X, y=None, **fit_params)[source]¶Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: |
|
---|---|
Returns: |
|
get_params
(deep=True)[source]¶Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
plot_filters
(info, components=None, ch_type=None, layout=None, vmin=None, vmax=None, cmap='RdBu_r', sensors=True, colorbar=True, scalings=None, units='a.u.', res=64, size=1, cbar_fmt='%3.1f', name_format='CSP%01d', show=True, show_names=False, title=None, mask=None, mask_params=None, outlines='head', contours=6, image_interp='bilinear', average=None, head_pos=None)[source]¶Plot topographic filters of components.
The filters are used to extract discriminant neural sources from the measured data (a.k.a. the backward model).
Parameters: |
|
---|---|
Returns: |
|
plot_patterns
(info, components=None, ch_type=None, layout=None, vmin=None, vmax=None, cmap='RdBu_r', sensors=True, colorbar=True, scalings=None, units='a.u.', res=64, size=1, cbar_fmt='%3.1f', name_format='CSP%01d', show=True, show_names=False, title=None, mask=None, mask_params=None, outlines='head', contours=6, image_interp='bilinear', average=None, head_pos=None)[source]¶Plot topographic patterns of components.
The patterns explain how the measured data was generated from the neural sources (a.k.a. the forward model).
Parameters: |
|
---|---|
Returns: |
|
set_params
(**params)[source]¶Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each
component of a nested object.
Returns
——-
self
transform
(X)[source]¶Estimate epochs sources given the CSP filters.
Parameters: |
|
---|---|
Returns: |
|