Skip to content

Course Project of the Coursera lecture Getting and Cleaning Data

Notifications You must be signed in to change notification settings

higgser/GetData_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Course Project 'Getting and Cleaning Data'

These are my solutions to the course project of the Coursera 'Getting and Cleaning Data' lecture.

Introduction

This project uses data collected from the accelerometers from the Samsung Galaxy S smartphone. The experiments have been carried out with a group of 30 volunteers within an age bracket of 19-48 years. The features selected for this database come from the accelerometer and gyroscope 3-axial raw signals. The time domain signals were captured at a constant rate of 50 Hz. Then they were filtered using a median filter and a 3rd order low pass Butterworth filter with a corner frequency of 20 Hz to remove noise. Similarly, the acceleration signal was then separated into body and gravity acceleration signals using another low pass Butterworth filter with a corner frequency of 0.3 Hz.

A full description is available at the site where the data was obtained:

http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones.

Here are the data for the project:

https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip.

The download script

If the source data has not been download to the current working directory, the download_data.R script can be used to download and extract the source file. The script downloads and unzips the data in the current working directory.

The clean-up and analysis script

The script run_analysis.R performs the cleanup and aggregation of the souce data. The following steps are performed.

  1. Merge the training and the test data sets
  2. Extract only the mean and standard deviation for each measurement
  3. Average of each variable for each activity and each subject
  4. Improve naming of variables and labels

The code book

The output of the script is the new data file uci_har_tidy.txt. The output contains 180 values of 66 parameters. The first two rows are the subject id and the performed activity.

The variable suffixes X, Y and Z are used to denote the signals in the x-, y- and z-directions. The variable prefix t denotes variables in the time space, where as the prefix f denotes variables in the frequency space after a FFT. Accelerations are measured in standard gravity units of g (about 9.81 meters/second^2). Angular velocities are measured in radians/second. However all variables have been normalized and bounded within [-1,1], so do not have units anymore. The mean and standard devation std is given for each measured interval.

  • subject: subject id from 1 to 30

  • activity: name of the activity (walking, walkingup, walkingdown, sitting, standing, laying)

  • BodyAcc: acceleration of body (16 variables)

    • tBodyAcc.[mean|std].[X|Y|Z]
    • fBodyAcc.[mean|std].[X|Y|Z]
    • scalar acceleration of body
      • tBodyAcc.[mean|std]
      • fBodyAcc.[mean|std]
  • BodyJerk: jerk of body (16 variables)

    • tBodyJerk.[mean|std].[X|Y|Z]
    • fBodyJerk.[mean|std].[X|Y|Z]
    • scalar jerk of body
      • tBodyJerk.[mean|std]
      • fBodyJerk.[mean|std]
  • GravityAcc: gravitational acceleration (8 Variables)

    • tGravityAcc.[mean|std].[X|Y|Z]
    • scalar gravitational acceleration
      • tGravityAcc.[mean|std]
  • BodyGyro: rotation velocity of body (16 variables)

    • tBodyGyro.[mean|std].[X|Y|Z]
    • fBodyGyro.[mean|std].[X|Y|Z]
    • scalar rotation velocity of body
      • tBodyGyro.[mean|std]
      • fBodyGyro.[mean|std]
  • BodyGyroJerk: angular acceleration (jerk?) of body (10 variables)

    • tBodyGyroJerk.[mean|std].[X|Y|Z]
    • scalar angular acceleration of body
      • tBodyGyroJerk.[mean|std]
      • fBodyGyroJerk.[mean|std]

About

Course Project of the Coursera lecture Getting and Cleaning Data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages