braindecode.preprocessing.preprocess#

braindecode.preprocessing.preprocess(concat_ds: BaseConcatDataset, preprocessors: list[Preprocessor], save_dir: str | None = None, overwrite: bool = False, n_jobs: int | None = None, offset: int = 0)[source]#

Apply preprocessors to a concat dataset.

Parameters:
  • concat_ds (BaseConcatDataset) – A concat of BaseDataset or WindowsDataset datasets to be preprocessed.

  • preprocessors (list(Preprocessor)) – List of Preprocessor objects to apply to the dataset.

  • save_dir (str | None) – If a string, the preprocessed data will be saved under the specified directory and the datasets in concat_ds will be reloaded with preload=False.

  • overwrite (bool) – When save_dir is provided, controls whether to delete the old subdirectories that will be written to under save_dir. If False and the corresponding subdirectories already exist, a FileExistsError will be raised.

  • n_jobs (int | None) – Number of jobs for parallel execution. See joblib.Parallel for a more detailed explanation.

  • offset (int) – If provided, the integer is added to the id of the dataset in the concat. This is useful in the setting of very large datasets, where one dataset has to be processed and saved at a time to account for its original position.

Returns:

Preprocessed dataset.

Return type:

BaseConcatDataset

Examples using braindecode.preprocessing.preprocess#

Cropped Decoding on BCIC IV 2a Dataset

Cropped Decoding on BCIC IV 2a Dataset

Basic Brain Decoding on EEG Data

Basic Brain Decoding on EEG Data

How to train, test and tune your model?

How to train, test and tune your model?

Hyperparameter tuning with scikit-learn

Hyperparameter tuning with scikit-learn

Training a Braindecode model in PyTorch

Training a Braindecode model in PyTorch

Benchmarking preprocessing with parallelization and serialization

Benchmarking preprocessing with parallelization and serialization

Load and save dataset example

Load and save dataset example

MOABB Dataset Example

MOABB Dataset Example

Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset

Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset

Data Augmentation on BCIC IV 2a Dataset

Data Augmentation on BCIC IV 2a Dataset

Searching the best data augmentation on BCIC IV 2a Dataset

Searching the best data augmentation on BCIC IV 2a Dataset

Self-supervised learning on EEG with relative positioning

Self-supervised learning on EEG with relative positioning

Fingers flexion decoding on BCIC IV 4 ECoG Dataset

Fingers flexion decoding on BCIC IV 4 ECoG Dataset

Sleep staging on the Sleep Physionet dataset using Chambon2018 network

Sleep staging on the Sleep Physionet dataset using Chambon2018 network

Sleep staging on the Sleep Physionet dataset using Eldele2021

Sleep staging on the Sleep Physionet dataset using Eldele2021

Sleep staging on the Sleep Physionet dataset using U-Sleep network

Sleep staging on the Sleep Physionet dataset using U-Sleep network

Process a big data EEG resource (TUH EEG Corpus)

Process a big data EEG resource (TUH EEG Corpus)