braindecode.datasets.WindowsDataset

class braindecode.datasets.WindowsDataset(windows, description=None, transform=None, targets_from='metadata', last_target_only=True)

Returns windows from an mne.Epochs object along with a target.

Dataset which serves windows from an mne.Epochs object along with their target and additional information. The metadata attribute of the Epochs object must contain a column called target, which will be used to return the target that corresponds to a window. Additional columns i_window_in_trial, i_start_in_trial, i_stop_in_trial are also required to serve information about the windowing (e.g., useful for cropped training). See braindecode.datautil.windowers to directly create a WindowsDataset from a BaseDataset object.

Parameters
windowsmne.Epochs

Windows obtained through the application of a windower to a BaseDataset (see braindecode.datautil.windowers).

descriptiondict | pandas.Series | None

Holds additional info about the windows.

transformcallable | None

On-the-fly transform applied to a window before it is returned.

targets_fromstr

Defines whether targets will be extracted from mne.Epochs metadata or mne.Epochs misc channels (time series targets). It can be metadata (default) or channels.

Methods

set_description(description, overwrite=False)

Update (add or overwrite) the dataset description.

Parameters
description: dict | pd.Series

Description in the form key: value.

overwrite: bool

Has to be True if a key in description already exists in the dataset description.