moabb.paradigms.CognitiveTask#
- class moabb.paradigms.CognitiveTask(n_classes=None, fmin=8, fmax=32, events=None, tmin=0.0, tmax=None, baseline=None, channels=None, resample=None, scorer=None, overlap=None, reject_by_annotation=True)[source]#
N-class cued cognitive task.
Standalone paradigm for non-motor endogenous tasks decoded from trial-wise EEG: handwriting/stroke imagery, mental arithmetic, mental rotation / spatial navigation imagery, word generation / verbal fluency, music or melody imagery. Follows the
Cued Cognitive Tasksbranch of the #1056 discussion (jarod1212), distinct from motor imagery (ERD/ERS) and from evoked ERP/P300.Decoded with the same trial-epoch machinery as motor imagery; defaults match
MotorImagery(8-32 Hz bandpass), so handwriting-imagery scripts can swap names without behavior changes. Valid on bothparadigm="cognitive"datasets and the existingparadigm="imagery"tag, so current loaders such as Wang2026Handwriting work today while future loaders can adopt the"cognitive"tag.By default, metric is ‘roc-auc’ if 2 classes and ‘accuracy’ if more
- Parameters:
events (List of str) – event labels used to filter datasets.
n_classes (int,) – number of classes each dataset must have. If events is given, requires all task 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.
- 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 (
BaseDataset) – 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.