Giter VIP home page Giter VIP logo

data-cleaning-assignment's Introduction

---
title: "Data Cleaning Project"
output: html_document
---

This dataset is derived from the Human Activity Recognition using Smartphones Dataset, Version 1.0. 

For the Human Activity Recognition using Smartphones Dataset, the experiments were carried out with a group of 30 volunteers within an age bracket of 19-48 years. Each person performed six activities (WALKING, WALKING_UPSTAIRS, WALKING_DOWNSTAIRS, SITTING, STANDING, LAYING) wearing a smartphone (Samsung Galaxy S II) on the waist. Using its embedded accelerometer and gyroscope, they captured 3-axial linear acceleration and 3-axial angular velocity at a constant rate of 50Hz. The experiments have been video-recorded to label the data manually. 

The original dataset separated the data into two sets, a training and test dataset. Our dataset combines the training and test datasets together. 

The majority of variables in this dataset (all variables aside from the subject and activity variables) represent the mean of each mean (mean) or standard deviation (std) measurement from the original dataset, by subject number and activity. 

These original measurements are described below.

The original measurements are features selected for this database from the accelerometer and gyroscope 3-axial raw signals tAcc-XYZ and tGyro-XYZ. These time domain signals (prefix 't' to denote time) 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 (tBodyAcc-XYZ and tGravityAcc-XYZ) using another low pass Butterworth filter with a corner frequency of 0.3 Hz. 

Subsequently, the body linear acceleration and angular velocity were derived in time to obtain Jerk signals (tBodyAccJerk-XYZ and tBodyGyroJerk-XYZ). Also the magnitude of these three-dimensional signals were calculated using the Euclidean norm (tBodyAccMag, tGravityAccMag, tBodyAccJerkMag, tBodyGyroMag, tBodyGyroJerkMag). 

Finally a Fast Fourier Transform (FFT) was applied to some of these signals producing fBodyAcc-XYZ, fBodyAccJerk-XYZ, fBodyGyro-XYZ, fBodyAccJerkMag, fBodyGyroMag, fBodyGyroJerkMag. (Note the 'f' to indicate frequency domain signals). 

These signals were used to estimate variables of the feature vector for each pattern:  
'-XYZ' is used to denote 3-axial signals in the X, Y and Z directions.

The measurements were normalized and bounded within [-1, 1]. 

Data Manipulation and Cleaning Description:
Both training and test datasets were read in and concatenated. Only the measurement variables pertaining to means and standard deviations were retained. Any repetetive or oblique variable names were renamed. The dataset was then transformed to take the mean of each measurement per subject, per activity. The final dataset has all of the measurements per activity, per subject in each row. 


Variable Names:

"Activity" - There are 6 different activities during which subjects were measured: laying, sitting, standing, walking, walking downstairs, and walking upstairs.      
"Subject" - There are 30 unique subjects, identified by numbers 1-30.

The values for all of the following measurements represent the mean value for the measurement, by subject, by activity.
“tBodyAcc.mean..X”
"tBodyAcc.mean...Y"          
"tBodyAcc.mean...Z"           
"tGravityAcc.mean...X"        
"tGravityAcc.mean...Y"       
"tGravityAcc.mean...Z"        
"tBodyAccJerk.mean...X"      
"tBodyAccJerk.mean...Y"      
"tBodyAccJerk.mean...Z"       
"tBodyGyro.mean...X"          
"tBodyGyro.mean...Y"         
"tBodyGyro.mean...Z"         
"tBodyGyroJerk.mean...X"      
"tBodyGyroJerk.mean...Y"     
"tBodyGyroJerk.mean...Z"      
"tBodyAccMag.mean.."          
"tGravityAccMag.mean.."      
"tBodyAccJerkMag.mean.."      
"tBodyGyroMag.mean.."         
"tBodyGyroJerkMag.mean.."    
"fBodyAcc.mean...X"           
"fBodyAcc.mean...Y"           
"fBodyAcc.mean...Z"          
"fBodyAcc.meanFreq...X"      
"fBodyAcc.meanFreq...Y"       
"fBodyAcc.meanFreq...Z"      
"fBodyAccJerk.mean...X"       
"fBodyAccJerk.mean...Y"       
"fBodyAccJerk.mean...Z"      
"fBodyAccJerk.meanFreq...X"  
"fBodyAccJerk.meanFreq...Y"  
"fBodyAccJerk.meanFreq...Z"  
"fBodyGyro.mean...X"          
"fBodyGyro.mean...Y"          
"fBodyGyro.mean...Z"         
"fBodyGyro.meanFreq...X"      
"fBodyGyro.meanFreq...Y"      
"fBodyGyro.meanFreq...Z"     
"fBodyAccMag.mean.."          
"fBodyAccMag.meanFreq.."      
"fBodyAccJerkMag.mean.."     
"fBodyAccJerkMag.meanFreq.."  
"fBodyGyroMag.mean.."         
"fBodyGyroMag.meanFreq.."    
"fBodyGyroJerkMag.mean.."     
"fBodyGyroJerkMag.meanFreq.." 
"tBodyAcc.std...X"           
"tBodyAcc.std...Y"            
"tBodyAcc.std...Z"            
"tGravityAcc.std...X"        
"tGravityAcc.std...Y"         
"tGravityAcc.std...Z"         
"tBodyAccJerk.std...X"       
"tBodyAccJerk.std...Y"        
"tBodyAccJerk.std...Z"        
"tBodyGyro.std...X"          
"tBodyGyro.std...Y"           
"tBodyGyro.std...Z"           
"tBodyGyroJerk.std...X"      
"tBodyGyroJerk.std...Y"       
"tBodyGyroJerk.std...Z"       
"tBodyAccMag.std.."          
"tGravityAccMag.std.."        
"tBodyAccJerkMag.std.."       
"tBodyGyroMag.std.."         
"tBodyGyroJerkMag.std.."      
"fBodyAcc.std...X"           
"fBodyAcc.std...Y"           
"fBodyAcc.std...Z"            
"fBodyAccJerk.std...X"        
"fBodyAccJerk.std...Y"       
"fBodyAccJerk.std...Z"        
"fBodyGyro.std...X"           
"fBodyGyro.std...Y"          
"fBodyGyro.std...Z"           
"fBodyAccMag.std.."           
"fBodyBodyAccJerkMag.std.."

data-cleaning-assignment's People

Contributors

angelinepro avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.