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 itstarget_transform). In classification they give one output per distinct value: class probabilities needn_outputsorclasses.mode (
Literal['classification','regression']) – Mode of the taskclasses (
list|None) – List of classes for classification, as stored, before anytarget_transform.n_outputsis 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]