braindecode.datasets.create_from_X_y#
- braindecode.datasets.create_from_X_y(X, y, drop_last_window, sfreq, ch_names=None, window_size_samples=None, window_stride_samples=None)[source]#
Create a BaseConcatDataset of WindowsDatasets from X and y to be used for.
decoding with skorch and braindecode, where X is a list of pre-cut trials and y are corresponding targets.
- Parameters:
X (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – list of pre-cut trials as n_trials x n_channels x n_timesy (
TypeAliasType) – targets corresponding to the trialsdrop_last_window (
bool) – whether or not have a last overlapping window, when windows/windows do not equally divide the continuous signalsfreq (
float) – Sampling frequency of signals.ch_names (
TypeAliasType) – Names of the channels.
- Returns:
windows_datasets – X and y transformed to a dataset format that is compatible with skorch and braindecode
- Return type: