Requirements:
This project runs on python 3.4.4.
You can run with either Spyder or Jupyter Notebook.
One of the easiest ways is to install Anaconda package 4.0.5. which includes both Spyder and Jupyter Notebook.
Installation:
- Download the project folder
- Unzip the folder
- Import the project to Spyder or Jupyter Notebook
- Run PreprocessData.py file to preprocess the raw data for each subject and store into DataFrames
- Run GetFeaturesTarget.py file to extract 2-second clips and extract features from the 2-second clips. Those features will then be written to files and stored into FeaturesTarget folder
- Run the main file HmmCode.py to see the results
Notes: Step 4 and 5 are not neccessarily repeated every time you want to run the code. If there is nothing changed to the files, you can skip step 4 and 5.
Without making any modification, the code will automatically run all classifiers, including SVMClassifier, logisticRegression, decisionTreeClassification, kNearestNeighborsClassifier, naiveBayesClassifier, and randomForestClassifier
For each classifier, three cross validation methods will run: within-subject, across-subject and hybrid cross validation (haven't tested yet).
Results of all classifiers will be stored in Results/ClassifierName folder, where ClassifierName is the name of the classifier used.
FeaturesTarget folder contains csv files of features and target of all the thirdteen subjects
To change the clip size:
- Open GetFeaturesTarget.py file into Spyder or Jupyter Notebook
- Search for #WHERE TO CHANGE CLIP SIZE comment
- Change the clip size
- Run the file
After running the file, FeaturesTarget folder will be overwritten.