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)¶
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: array-like
list of pre-cut trials as n_trials x n_channels x n_times
- y: array-like
targets corresponding to the trials
- drop_last_window: bool
whether or not have a last overlapping window, when windows/windows do not equally divide the continuous signal
- sfreq: float
Sampling frequency of signals.
- ch_names: array-like
Names of the channels.
- window_size_samples: int
window size
- window_stride_samples: int
stride between windows
- Returns
- windows_datasets: BaseConcatDataset
X and y transformed to a dataset format that is compatible with skorch and braindecode