Your job is to design a script that processes Human Motion Data and prepares it for machine learning. Once again read the mini-project.mlx file and run through the example code before starting the questions. In this project you will be analyzing raw data, preprocessing it, creating feature extraction algorithms, and most importantly practicing Matlab. There has to be a submition of a MLX. and PDF file.
Mini Project Submission Template
Name:
Date:
ID Number:
Instructions
Please read the miniproject.mlx file before starting the assignment. The assignment is broken down into multiple sections, your job is to fillout the sections with your code and aswer all of the questions. You need to directly modify this document with your solutions, name, ect. Once you have completed the assignment convert it into a pdf and upload the .mlx file and the pdf to ilearn. Do not work on this project with a partner or in groups, everyone needs to have unique solutions. This project accounts for a significant portion of you grade; make sure you submit it on time, with unique solutions, in proper format, and answer all of the questions to the best of your ability.
Your job is to design a script that process Human Motion Data and prepare it for machine learning. Once again read the miniproject.mlx file and run through the example code before starting the questions. In this project you will be analysing raw data, preprocessing it, creating feature extraction algorithms, and most importantly practicing matlab.
Import Raw Data
Make sure the RawData folder is in the same directory as this file and the miniproject.mlx file otherwise the data will not import.
%%% Clears workspace and command window and closes any figures %%%
clc
clear all
close all
%%% Import Raw Data %%%
for i = 1:5 % five motions
if i == 1
file = 'RawData/sitting1.mat'; % data location and file name
elseif i == 2
file = 'RawData/standing1.mat';
elseif i == 3
file = 'RawData/using1.mat';
elseif i == 4
file = 'RawData/walking1.mat';
else
file = 'RawData/windmill1.mat';
end
customData{:,i} = load(file); % saves each motion time table into the cell array called customData
end
% Display CustomData
disp(customData) % 1 x 5 of structures, each structure contains X number of rows and 3 columns (x,y,Z)
Assignment Part 1 - Visualizing Raw Data
Look at accessing data in a structrue and visualizing raw data sections.
1)
Choose 1 static motion and 1 dynamic motion.
You can not choose sitting!
2)
Plot all axes (X, Y, and Z) for each motion in tiledlayout plot for one motion. The other motion must have all axes (X, Y, and Z) plots within 1 figure window with unique colors, linestyles or markers and a ledgend. You need to include a title, x axis labels, y axis labels, increase the linewidth for each plot/ figure.
Question:
1) What motions did you choose?
Solution:
%%%% Place Your Code Here %%%%
Assignment Part 2 - Preprocess Data "Cleaning"
Look at Preprocessing Data "Cleaning" Section
1)
Clean the data for all axes (X, Y, and Z) for each motion. All axes for each motion needs to have a minimum of 1000 data points. Remember the amount of data points must be consistant for each axes and for both motions.
2)
Plot the preprocess data for each motion. Use a seperate figure for each motion. You can choose whatever plot style you want, however you need to include a title, x axis labels, y axis labels, increase the linewidth for each plot/ figure.
Questions:
1) How many data points did you cut off from the begining of the raw data?
Solution:
2) How many data points did you cut off from the end of the raw data?
Solution:
3) How many data points are included in your processed data?
Solution:
%%%% Place Your Code Here %%%%
Assignment Part 3 - Windowing Your Data "Chunking"
Look at Preprcoessing Data "Windowing or Chunking" Section
1)
Preprocess the data into windows/chunks for all axes (X, Y, and Z) for each motion. You can choose any window data point length, however you must have a minimum of 30 windows of data for each axis and motion.
You can not choose a window length of 25 datapoints and you must have a whole number of data windows.
Example:
1000 data points = cleaned data
10 data points for window length
equals 100 data windows.
You can not have a 12 data points for window length because this would result in 83.333 data windows.
Questions:
1) How many data points did you use for your data window?
solution:
2) How many data windows did you have?
solution:
%%%% Place Your Code Here %%%%
Assignment Part 4 - Custom Feature Extraction
Look at Feature Extraction Section.
1)
Create 2 custom feature extraction functions.
You can not use MATLAB built in functions or create a custom Average function.
You can design your feature extraction functions to highlight any feature "patterns" in the process data. Make sure you process all data axes for each motion. Include your functions at the bottom of the MLX script in the function section.
Some common feature extraction methods:
Mean "Average" - Do not use!
Number of Positive Numbers
Number of negative Numbers
Number of slope Sign Changes
Standard Deviation
Number of data above a threshold value
Number of data peaks
2)
Plot the feature extracted data for each motion. Use a seperate figure for each motion. You can choose whatever plot style you want, however you need to include a title, x axis labels, y axis labels, increase the linewidth for each plot/figure.
Questions:
1) What is the name of your custom feature extracted functions?
Solution:
2) What feature extraction methods did you use?
Solution:
%%%% Place Your Code Here %%%%
Assignment Part 5 - Feature Matrix Organization
Look at Feature Matrix "Data Organization" Section.
1)
Organize all the feature extracted data into a single matrix. The format of the matrix is listed below: You should have 12 rows of data and X number of column depending on the number of data windows you chose.
r1:
X axis data for first Motion, first feature extraction method
r2:
Y axis data for first Motion, first feature extraction method
r3:
Z axis data for first Motion , first feature extraction method
r4:
X axis data for first Motion, second feature extraction method
r5:
Y axis data for first Motion, second feature extraction method
r6:
Z axis data for first Motion , second feature extraction method
r7:
X axis data for second Motion, first feature extraction method
r8:
Y axis data for second Motion, first feature extraction method
r9:
Z axis data for second Motion , first feature extraction method
r10: X axis data for second Motion, second feature extraction method
r11:
Y axis data for second Motion, second feature extraction method
r12:
Z axis data for second Motion , second feature extraction method
Questions:
1) What is the name of your feature matrix?
solution:
2) What is the size of your feature matrix?
solution:
%%%% Place Your Code Here %%%%
Place Your Custom Feature Extraction Functions Here
%%%% Place Your Code Here %%%%