Link Search Menu Expand Document

mixnet.preprocessing.BNCI2015_001

View source on GitHub

Table of contents

  1. mixnet.preprocessing.BNCI2015_001
    1. Time domain
      1. Subject-dependent setting
      2. Subject-independent setting
    2. Filter Bank Common Spatial Pattern (FBCSP)
      1. Subject-dependent setting
      2. Subject-independent setting
    3. Spectral Spatial mapping
      1. Subject-dependent setting
      2. Subject-independent setting
    4. Spectral Spatial Signals generation
      1. Subject-dependent setting
      2. Subject-independent setting

Time domain

View source on GitHub

Subject-dependent setting

Preprocess raw time-series EEG in subject-dependent setting using butter bandpass filter and resampling. Split data into train, validation and test sets using stratified k-fold cross-validation.

time_domain.subject_dependent(k_folds, 
                              pick_smp_freq,
                              bands, 
                              order, 
                              save_path,
                              num_class,
                              sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
bandslist list of low cut and high cut frequency bands e.g. [8, 30]
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

prep.BNCI2015_001.time_domain.subject_dependent_setting(k_folds=5,
                                                 pick_smp_freq=100, 
                                                 bands=[8, 30], 
                                                 order=5, 
                                                 save_path='datasets')

Subject-independent setting

Preprocess raw time-series EEG in subject-independent setting using butter bandpass filter and resampling. Split data into train, validation and test sets using stratified k-fold cross-validation.

time_domain.subject_independent(k_folds, 
                                pick_smp_freq,
                                bands, 
                                order, 
                                save_path,
                                num_class,
                                sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
bandslist list of low cut and high cut frequency bands e.g. [8, 30]
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

prep.BNCI2015_001.time_domain.subject_independent_setting(k_folds=5,
                                                    pick_smp_freq=100, 
                                                    bands=[8, 30], 
                                                    order=5, 
                                                    save_path='datasets')

Filter Bank Common Spatial Pattern (FBCSP)

View source on GitHub

Subject-dependent setting

Preprocess raw time-series EEG in subject-dependent setting using Filter Bank Common Spatial Pattern (FBCSP). Split data into train, validation and test sets using stratified k-fold cross-validation.

fbcsp.subject_dependent(k_folds, 
                        pick_smp_freq, 
                        n_components, 
                        bands, 
                        n_features, 
                        order, 
                        save_path,
                        num_class,
                        sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[4, 8], [8, 12], [12, 16], 
         [16, 20], [20, 24], [24, 28], 
         [28, 32], [32, 36], [36, 40]]

prep.BNCI2015_001.fbcsp.subject_dependent_setting(k_folds=5, 
                                            pick_smp_freq=100, 
                                            n_components=4, 
                                            bands=bands, 
                                            n_features=8, 
                                            order=5, 
                                            save_path='datasets')

Subject-independent setting

Preprocess raw time-series EEG in subject-independent setting using Filter Bank Common Spatial Pattern (FBCSP). Split data into train, validation and test sets using stratified k-fold cross-validation.

fbcsp.subject_independent(k_folds, 
                          pick_smp_freq, 
                          n_components, 
                          bands, 
                          n_features, 
                          order, 
                          save_path,
                          num_class,
                          sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[4, 8], [8, 12], [12, 16], 
         [16, 20], [20, 24], [24, 28], 
         [28, 32], [32, 36], [36, 40]]

prep.BNCI2015_001.fbcsp.subject_independent_setting(k_folds=5, 
                                              pick_smp_freq=100, 
                                              n_components=4, 
                                              bands=bands, 
                                              n_features=8, 
                                              order=5, 
                                              save_path='datasets')

Spectral Spatial mapping

View source on GitHub

Subject-dependent setting

Preprocess raw time-series EEG in subject-dependent setting using Spectral Spatial mapping. Split data into train, validation and test sets using stratified k-fold cross-validation.

spectral_spatial.subject_dependent(k_folds, 
                                   pick_smp_freq, 
                                   n_components, 
                                   bands, 
                                   n_features, 
                                   order, 
                                   save_path,
                                   num_class,
                                   sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_pick_bandsint number of filter bands
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[7.5,14],[11,13],[10,14],[9,12],[19,22],
         [16,22],[26,34],[17.5,20.5],[7,30],[5,14],
         [11,31],[12,18],[7,9],[15,17],[25,30],
         [20,25],[5,10],[10,25],[15,30],[10,12],
         [23,27],[28,32],[12,33],[11,22],[5,8],
         [7.5,17.5],[23,26],[5,20],[5,25],[10,20]]

prep.BNCI2015_001.spectral_spatial.subject_dependent_setting(k_folds=5, 
                                                       pick_smp_freq=100, 
                                                       n_components=10, 
                                                       bands=bands, 
                                                       n_pick_bands=20, 
                                                       order=5, 
                                                       save_path='datasets')

Subject-independent setting

Preprocess raw time-series EEG in subject-independent setting using Spectral Spatial mapping. Split data into train, validation and test sets using stratified k-fold cross-validation.

spectral_spatial.subject_independent(k_folds, 
                                     pick_smp_freq, 
                                     n_components, 
                                     bands, 
                                     n_features, 
                                     order, 
                                     save_path,
                                     num_class,
                                     sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_pick_bandsint number of filter bands
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[7.5,14],[11,13],[10,14],[9,12],[19,22],
         [16,22],[26,34],[17.5,20.5],[7,30],[5,14],
         [11,31],[12,18],[7,9],[15,17],[25,30],
         [20,25],[5,10],[10,25],[15,30],[10,12],
         [23,27],[28,32],[12,33],[11,22],[5,8],
         [7.5,17.5],[23,26],[5,20],[5,25],[10,20]]

prep.BNCI2015_001.spectral_spatial.subject_independent_setting(k_folds=5, 
                                                         pick_smp_freq=100, 
                                                         n_components=10, 
                                                         bands=bands, 
                                                         n_pick_bands=20, 
                                                         order=5, 
                                                         save_path='datasets')

Spectral Spatial Signals generation

View source on GitHub

Subject-dependent setting

Preprocess raw time-series EEG in subject-dependent setting using Spectral Spatial Signals generation. Split data into train, validation and test sets using stratified k-fold cross-validation.

spectral_spatial_signals.subject_dependent(k_folds, 
                                   pick_smp_freq, 
                                   n_components, 
                                   bands, 
                                   n_features, 
                                   order, 
                                   save_path,
                                   num_class,
                                   sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[4, 8], [8, 12], [12, 16], 
            [16, 20], [20, 24], [24, 28], 
            [28, 32], [32, 36], [36, 40]]

prep.BNCI2015_001.spectral_spatial_signals.subject_dependent_setting(k_folds=5, 
                                                       pick_smp_freq=100, 
                                                       n_components=4, 
                                                       bands=bands, 
                                                       order=5,
                                                       num_class=2, 
                                                       save_path='datasets')

Subject-independent setting

Preprocess raw time-series EEG in subject-independent setting using Spectral Spatial Signals generation. Split data into train, validation and test sets using stratified k-fold cross-validation.

spectral_spatial_signals.subject_independent(k_folds, 
                                     pick_smp_freq, 
                                     n_components, 
                                     bands, 
                                     n_features, 
                                     order, 
                                     save_path,
                                     num_class,
                                     sel_chs)

Arguments:

ArgumentsDescription
k_foldsint number of k-fold cross-validation.
pick_smp_freqint pick sample frequency (downsampling EEG to to pick_smp_freq)
n_componentsint number of components of CSP
bandslist list of low cut and high cut frequency bands of filter bank e.g. [[4, 8], [8, 12], ...]
n_featuresint number of features for mutual_info_classif
orderint number of order of butter bandpass filter
save_pathstr path to save processed EEG
num_classint number of classes. Default 2
sel_chslist or None. list if EEG channels. Default None

Example

import mixnet.preprocessing as prep

bands = [[4, 8], [8, 12], [12, 16], 
            [16, 20], [20, 24], [24, 28], 
            [28, 32], [32, 36], [36, 40]]

prep.BNCI2015_001.spectral_spatial_signals.subject_independent_setting(k_folds=5, 
                                                         pick_smp_freq=100, 
                                                         n_components=2, 
                                                         bands=bands, 
                                                         order=5, 
                                                         num_class=2,
                                                         save_path='datasets')