CS 390MB Fall 2016 Group 2 A2 Part 4
A project for CS390MB - Mobile Health Sensing and Monitoring
features.py, util.py, activity-recognition-train.py, collect-labelled-activity-data.py, activity-recognition.py)Starter Code (
This trains a decision tree classifier to identify activities based on accelerometer data. This is meant to be used via an app and a server. The server is now down so the server data gathering and prediction functionality won't work. However, it is still possible to train and evaluate the classifier with some data that has already been gathered.
All student implementations are surrounded with comments.
Training within k-fold validation loop as well as accuracy, precision, and recall calculations.
All feature extaction except
To get labeled data from the server saved to a csv
This will not work since the server is not currently running. If the server were running data could be collected and appened to
data/my-activity-data.csv like so:
This stores data in a file called my-activity-data.csv in the current directory. This is done in a section we can't change.
To train the classifier
To train on data from
This will train the classifier and serialize it into a pickle file called classifier.pickle. It will overwrite the file since it is there already.
To do server-side prediction
This will not work since the server is not currently running. If the server were running, make sure you have a classifier in
classifier.pickle and run:
Trains a decision tree classifier on data from
data/my-activity-data.csv and serializes the classifier to
Handles server-side activity recognition.
A serialization of the classifier.
Server side data collection.
Instructor provided this to handle windows.