Link Search Menu Expand Document

FBCSP-SVM Usage

View source on GitHub

Table of contents

  1. FBCSP-SVM Usage
    1. Preparation for FBCSP_SVM’s input
      1. Downloading a particular dataset
      2. Preprocessing based on Filter Bank Common Spatial Pattern (FBCSP). over the considered dataset
      3. Build, fit, and evaluate FBCSP_SVM

Preparation for FBCSP_SVM’s input

An example of FBCSP_SVM’s input on the BCIC IV 2a dataset (All settings are set up as optimal settings in the original paper).

Downloading a particular dataset

View source on GitHub

python download_datasets.py --dataset 'BCIC2a'

Preprocessing based on Filter Bank Common Spatial Pattern (FBCSP). over the considered dataset

View source on GitHub

python prep_FBCSP.py --dataset 'BCIC2a'

Build, fit, and evaluate FBCSP_SVM

View source on GitHub

# Subject-dependent MI classification
python run_FBCSP_SVM.py --model_name 'FBCSP_SVM' --dataset 'BCIC2a' --train_type 'subject_dependent' --data_type 'fbcsp' --num_class 2  --num_chs 20 

# Subject-independent MI classification
python run_FBCSP_SVM.py --model_name 'FBCSP_SVM' --dataset 'BCIC2a' --train_type 'subject_independent' --data_type 'fbcsp' --num_class 2  --num_chs 20 

Arguments:

ArgumentsDescriptionDefault 
model_namestr prefix to save model‘FBCSP_SVM’ 
datasetstr prefix to pick up a particular dataset and save model‘BCIC2a’ 
train_typestr prefix to pick up a particular traning manner and save model‘subject_dependent’ 
data_typestr prefix to select data type of input‘time_domain’ 
num_classint number of classes2 
num_chsint number of classes20 
log_dirstr path to save model‘logs’ 
subjectsint or list of int or None list of range test subject, if None, use all subjectsNone-