moabb.paradigms.MotorImagery#
- class moabb.paradigms.MotorImagery(n_classes=None, **kwargs)[source]#
N-class motor imagery.
Metric is ‘roc-auc’ if 2 classes and ‘accuracy’ if more
- Parameters
events (List of str) – event labels used to filter datasets (e.g. if only motor imagery is desired).
n_classes (int,) – number of classes each dataset must have. If events is given, requires all imagery sorts to be within the events list.
fmin (float (default 8)) – cutoff frequency (Hz) for the high pass filter
fmax (float (default 32)) – cutoff frequency (Hz) for the low pass filter
tmin (float (default 0.0)) – Start time (in second) of the epoch, relative to the dataset specific task interval e.g. tmin = 1 would mean the epoch will start 1 second after the beginning of the task as defined by the dataset.
tmax (float | None, (default None)) – End time (in second) of the epoch, relative to the beginning of the dataset specific task interval. tmax = 5 would mean the epoch will end 5 second after the beginning of the task as defined in the dataset. If None, use the dataset value.
baseline (None | tuple of length 2) – The time interval to consider as “baseline” when applying baseline correction. If None, do not apply baseline correction. If a tuple (a, b), the interval is between a and b (in seconds), including the endpoints. Correction is applied by computing the mean of the baseline period and subtracting it from the data (see mne.Epochs)
channels (list of str | None (default None)) – list of channel to select. If None, use all EEG channels available in the dataset.
resample (float | None (default None)) – If not None, resample the eeg data with the sampling rate provided.
- property datasets#
Property that define the list of compatible datasets.
- is_valid(dataset)[source]#
Verify the dataset is compatible with the paradigm.
This method is called to verify dataset is compatible with the paradigm.
This method should raise an error if the dataset is not compatible with the paradigm. This is for example the case if the dataset is an ERP dataset for motor imagery paradigm, or if the dataset does not contain any of the required events.
- Parameters
dataset (dataset instance) – The dataset to verify.
- property scoring#
Property that defines scoring metric (e.g. ROC-AUC or accuracy or f-score), given as a sklearn-compatible string or a compatible sklearn scorer.
Examples using moabb.paradigms.MotorImagery
#
Cross-session motor imagery with deep learning EEGNet v4 model
Fixed interval windows processing