Background
We have a dataset of human activity detection which we got from an IMU sensor of a smartphone.
IMU unit, or inertial moment unit is a sensor which detects the movement of a body attached to it. It consists of:
1. Accelerometer, which works in the principle of capacitance and inertia, and provides the Linear acceleration in the x, y, and z direction.
2. Gyroscope, which works in the principle of Coriolis effect, and provides the angular velocity in the x, y, and z direction.
The experiment was carried out by 24 subjects with varied height, weight, age and gender.
The device data was collected for multiple activities and were abbreviated as follows:
dws: downstairs
ups: upstairs
sit: sitting
std: standing
wlk: walking
jog: jogging
Dataset Description
You will receive the dataset for this experiment. In the dataset, you will have the following folders:
data_subjects_info.csv: A csv file containing information about the human of 24 subjects, the features being weight, height, age, gender.
A_DeviceMotion_data: This dataset contains two subfolders:
A. A_DeviceMotion_data: The IMU datasets for the experiment splitted into subfolders, based on activity. Each activity has been performed 2-3 times. This folder contains 15 subfolders:
dws_1
dws_2
dws_11
jog_9
jog_16
sit_5
sit_13
std_6
std_14
ups_3
ups_12
ups_4
wlk_15
wlk_8
wlk_7
These folders are named using the format <activity>_<iteration>. So wlk_8 and wlk_15 are different iterations of walking activities.
Furthermore, each of these folders contains 24 csv files, each for one subject. The files are named using the following convention: sub_<subject id>.csv , so, wlk_15/sub_3.csv will contain the data for the iteration 15 of activity walk, for subject 3.
attitude.roll : Rotation around the front-to-back axis is called roll.
attitude.pitch : Rotation around the side-to-side axis is called pitch.
attitude.yaw : Rotation around the vertical axis is called yaw.
gravity.x : Gravity towards x axis.
gravity.y : Gravity towards y axis.
gravity.z : Gravity towards z axis.
rotationRate.x : Angular Velocity in x direction.
rotationRate.y : Angular Velocity in y direction.
rotationRate.z : Angular Velocity in z direction.
userAcceleration.x: Linear Acceleration in x direction.
userAcceleration.y: Linear Acceleration in y direction.
userAcceleration.z: Linear Acceleration in z direction.
B. __MACOSX: Datasets for macbook support, you can ignore this folder.
Import the dataset into a python code using pandas, and do the following:
a. Create four line graphs to represent the jogging activity data for candidates 20, 21, and 22. Each graph should focus on a different parameter: attitude, gravity, rotationRate, and userAcceleration. For each parameter, include all its subparameters (e.g., x, y, z) on the same graph. Additionally, each graph should compare the data from all three candidates.
b. Generate box plots for the jogging activity of Candidate 2 and Candidate 7. Report your observations by comparing the plots you generated, for each factor.
c. Generate box plots for all the gender 1 candidates for the activity “downstair(dws)”, for each factor. Which candidate has the most varied speed? Explain how you arrived at the conclusion.
2. Using pandas, create a new dataframe and include the following columns:
I. Serial Number
II. Activity ID
III. Activity Name
IV. Iteration Number
V. Subject Code
VI. Subject Weight
VII. Subject Height
VIII. Subject Age
IX. Subject Gender
X. Attitude: Mean value of attitude.pitch, attitude.yaw and altitude.roll
XI. gravity : Median value of gravity.x, gravity.y and gravity.z
XII. rotationRate: mode value of rotationRate.x, rotationRate.y and rotationRate.z
XIII. userAcceleration: variance of userAcceleration.x, userAcceleration.y and userAcceleration.z.
Dataset credits: https://www.kaggle.com/datasets/malekzadeh/motionsense-dataset
Useful links: