braindecode.datasets.SleepPhysionet

class braindecode.datasets.SleepPhysionet(subject_ids=None, recording_ids=None, preload=False, load_eeg_only=True, crop_wake_mins=30)

Sleep Physionet dataset.

Sleep dataset from https://physionet.org/content/sleep-edfx/1.0.0/. Contains overnight recordings from 78 healthy subjects.

See [MNE example](https://mne.tools/stable/auto_tutorials/sample-datasets/plot_sleep.html).

Parameters
subject_ids: list(int) | int | None

(list of) int of subject(s) to be loaded. If None, load all available subjects.

recording_ids: list(int) | None

Recordings to load per subject (each subject except 13 has two recordings). Can be [1], [2] or [1, 2] (same as None).

preload: bool

If True, preload the data of the Raw objects.

load_eeg_only: bool

If True, only load the EEG channels and discard the others (EOG, EMG, temperature, respiration) to avoid resampling the other signals.

crop_wake_mins: float

Number of minutes of wake time to keep before the first sleep event and after the last sleep event. Used to reduce the imbalance in this dataset. Default of 30 mins.

Attributes
cummulative_sizes
transform

Methods

get_metadata()

Concatenate the metadata and description of the wrapped Epochs.

save(path[, overwrite])

Save dataset to files.

split([by, property, split_ids])

Split the dataset based on information listed in its description DataFrame or based on indices.

cumsum

get_metadata()

Concatenate the metadata and description of the wrapped Epochs.

Returns
pd.DataFrame:

DataFrame containing as many rows as there are windows in the BaseConcatDataset, with the metadata and description information for each window.

save(path, overwrite=False)

Save dataset to files.

Parameters
path: str

Directory to which .fif / -epo.fif and .json files are stored.

overwrite: bool

Whether to delete old files (.json, .fif, -epo.fif) in specified directory prior to saving.

split(by=None, property=None, split_ids=None)

Split the dataset based on information listed in its description DataFrame or based on indices.

Parameters
by: str | list(int) | list(list(int))

If by is a string, splitting is performed based on the description DataFrame column with this name. If by is a (list of) list of integers, the position in the first list corresponds to the split id and the integers to the datapoints of that split.

property: str

Some property which is listed in info DataFrame.

split_ids: list(int) | list(list(int))

List of indices to be combined in a subset.

Returns
splits: dict{str: BaseConcatDataset}

A dictionary with the name of the split (a string) as key and the dataset as value.