In the previous Matlab grader problems, we have created our own classifier method based on fitting PCA models to different classes. Now let's try it out on a new dataset!
The humanactivity dataset contains thousands of samples of a known-class, 60 feature dataset. The 'class' is 1 of 5 possible human activities: sitting, walking, dancing, running, and standing. The 'features' are features derived from acceleration measurements from the accelerometer sensor of a smartphone located in the participant's pocket taken during the course of the recorded activity. If interested, you can find more information about this dataset here.
Your goal is to create a classifier program that could be run on a smartphone to classify a person's activity from sensor measurements.
Load the humanactivity dataset into MATLAB and divide it into a training and testing set using the following code.
load humanactivity
D_train = feat(1:2:end,:);
class_train = actid(1:2:end);
D_test = feat(2:2:end,:);
class_test = actid(2:2:end);
Use your my_fitpca function create a classification model with the training set.
Use your classification model with your my_predictpca function to estimate classifications on the testing set
What is your classification accuracy on the testing set (percent correct), accurate to 2 decimal places?