braindecode.datautil.infer_signal_properties#

braindecode.datautil.infer_signal_properties(X, y=None, mode='classification', classes=None, n_outputs=None)[source]#

Infers signal properties from the data.

The extracted signal properties are:

  • n_chans: number of channels

  • n_times: number of time points

  • n_outputs: number of outputs

  • chs_info: channel information

  • sfreq: sampling frequency

The returned dictionary can serve as kwargs for model initialization.

Depending on the type of input passed, not all properties can be inferred.

Parameters:
  • X (array-like or mne.BaseEpochs or Dataset) – Input data

  • y (array-like or None) – Targets of array-like X, ignored for a dataset, which holds its own (after its target_transform). In classification they give one output per distinct value: class probabilities need n_outputs or classes.

  • mode (Literal['classification', 'regression']) – Mode of the task

  • classes (list | None) – List of classes for classification, as stored, before any target_transform. n_outputs is its length.

  • n_outputs (int | None) – Number of outputs, if known: it is returned as is and the targets are not read.

Returns:

signal_kwargs – Dictionary with signal-properties. Can serve as kwargs for model initialization.

Return type:

dict[Literal['n_outputs', 'n_chans', 'chs_info', 'n_times', 'input_window_seconds', 'sfreq'], Any]

Examples using braindecode.datautil.infer_signal_properties#

Simple training on MNE epochs

Simple training on MNE epochs

Basic Brain Decoding on EEG Data

Basic Brain Decoding on EEG Data

Interpretability of EEG Decoders

Interpretability of EEG Decoders