Skip to content

bielik/getting_and_cleaning_data

Repository files navigation

Final Assignment for "Getting and Cleaning Data" cource by Johns Hopkins University at Coursera.org
Author: Martin Bielik

Data used in the assignment:
==================================================================
Human Activity Recognition Using Smartphones Dataset
Version 1.0
==================================================================
Jorge L. Reyes-Ortiz, Davide Anguita, Alessandro Ghio, Luca Oneto.
Smartlab - Non Linear Complex Systems Laboratory
DITEN - Università degli Studi di Genova.
Via Opera Pia 11A, I-16145, Genoa, Italy.
[email protected]
www.smartlab.ws
==================================================================

# Study design:
======================================

The experiments have been 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, we 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 obtained dataset has been randomly partitioned into two sets, where 70% of the volunteers was selected for generating the training data and 30% the test data. 

The sensor signals (accelerometer and gyroscope) were pre-processed by applying noise filters and then sampled in fixed-width sliding windows of 2.56 sec and 50% overlap (128 readings/window). The sensor acceleration signal, which has gravitational and body motion components, was separated using a Butterworth low-pass filter into body acceleration and gravity. The gravitational force is assumed to have only low frequency components, therefore a filter with 0.3 Hz cutoff frequency was used. From each window, a vector of features was obtained by calculating variables from the time and frequency domain. See 'features_info.txt' for more details. 


## For each record it is provided:

- Triaxial acceleration from the accelerometer (total acceleration) and the estimated body acceleration.
- Triaxial Angular velocity from the gyroscope. 
- A 561-feature vector with time and frequency domain variables. 
- Its activity label. 
- An identifier of the subject who carried out the experiment.

## The dataset includes the following files:
=========================================

- 'README.rm'

- 'features_info.txt': Shows information about the variables used on the feature vector.

- 'features.txt': List of all features.

- 'activity_labels.txt': Links the class labels with their activity name.

- 'train/X_train.txt': Training set.

- 'train/y_train.txt': Training labels.

- 'test/X_test.txt': Test set.

- 'test/y_test.txt': Test labels.

- 'tidy data set.txt' : Processed data set with average of each mean and standard deviation measurment for each activity and each subject

## Data processing:
========================================
1. Merges the training and the test sets to create one data set.
2. Uses descriptive activity names to name the activities in the data set
3. Appropriately labels the data set with descriptive variable names.
4. Extracts only the measurements on the mean and standard deviation for each measurement.

## Data analysis:
=======================================
From the processed data set, creates a second, independent tidy data set with the average of each variable for each activity and each subject

Note: for details on processing and analysis, see the run_analysis.R file

# Code book:
=======================================

activity
	Description: Activity type
	Type: Factor variable, 6 levels, < "WALKING", "WALKING_UPSTAIRS", "WALKING_DOWNSTAIRS", "SITTING", "STANDING", "LAYING">
	Unit: NA

studentID
	Description: Student identification number
	Type: Factor variable, 30 levels, <"1", "2"...,"30">
	Unit: NA

"tBodyAcc-mean()-X"                      
"Average-tBodyAcc-mean()-Y"               "Average-tBodyAcc-mean()-Z"               "Average-tBodyAcc-std()-X"               
"Average-tBodyAcc-std()-Y"                "Average-tBodyAcc-std()-Z"                "Average-tGravityAcc-mean()-X"           
"Average-tGravityAcc-mean()-Y"            "Average-tGravityAcc-mean()-Z"            "Average-tGravityAcc-std()-X"            
"Average-tGravityAcc-std()-Y"             "Average-tGravityAcc-std()-Z"             "Average-tBodyAccJerk-mean()-X"          
"Average-tBodyAccJerk-mean()-Y"           "Average-tBodyAccJerk-mean()-Z"           "Average-tBodyAccJerk-std()-X"           
"Average-tBodyAccJerk-std()-Y"            "Average-tBodyAccJerk-std()-Z"            "Average-tBodyGyro-mean()-X"             
"Average-tBodyGyro-mean()-Y"              "Average-tBodyGyro-mean()-Z"              "Average-tBodyGyro-std()-X"              
"Average-tBodyGyro-std()-Y"               "Average-tBodyGyro-std()-Z"               "Average-tBodyGyroJerk-mean()-X"         
"Average-tBodyGyroJerk-mean()-Y"          "Average-tBodyGyroJerk-mean()-Z"          "Average-tBodyGyroJerk-std()-X"          
"Average-tBodyGyroJerk-std()-Y"           "Average-tBodyGyroJerk-std()-Z"           "Average-tBodyAccMag-mean()"             
"Average-tBodyAccMag-std()"               "Average-tGravityAccMag-mean()"           "Average-tGravityAccMag-std()"           
"Average-tBodyAccJerkMag-mean()"          "Average-tBodyAccJerkMag-std()"           "Average-tBodyGyroMag-mean()"            
"Average-tBodyGyroMag-std()"              "Average-tBodyGyroJerkMag-mean()"         "Average-tBodyGyroJerkMag-std()"         
"Average-fBodyAcc-mean()-X"               "Average-fBodyAcc-mean()-Y"               "Average-fBodyAcc-mean()-Z"              
"Average-fBodyAcc-std()-X"                "Average-fBodyAcc-std()-Y"                "Average-fBodyAcc-std()-Z"               
"Average-fBodyAcc-meanFreq()-X"           "Average-fBodyAcc-meanFreq()-Y"           "Average-fBodyAcc-meanFreq()-Z"          
"Average-fBodyAccJerk-mean()-X"           "Average-fBodyAccJerk-mean()-Y"           "Average-fBodyAccJerk-mean()-Z"          
"Average-fBodyAccJerk-std()-X"            "Average-fBodyAccJerk-std()-Y"            "Average-fBodyAccJerk-std()-Z"           
"Average-fBodyAccJerk-meanFreq()-X"       "Average-fBodyAccJerk-meanFreq()-Y"       "Average-fBodyAccJerk-meanFreq()-Z"      
"Average-fBodyGyro-mean()-X"              "Average-fBodyGyro-mean()-Y"              "Average-fBodyGyro-mean()-Z"             
"Average-fBodyGyro-std()-X"               "Average-fBodyGyro-std()-Y"               "Average-fBodyGyro-std()-Z"              
"Average-fBodyGyro-meanFreq()-X"          "Average-fBodyGyro-meanFreq()-Y"          "Average-fBodyGyro-meanFreq()-Z"         
"Average-fBodyAccMag-mean()"              "Average-fBodyAccMag-std()"               "Average-fBodyAccMag-meanFreq()"         
"Average-fBodyBodyAccJerkMag-mean()"      "Average-fBodyBodyAccJerkMag-std()"       "Average-fBodyBodyAccJerkMag-meanFreq()" 
"Average-fBodyBodyGyroMag-mean()"         "Average-fBodyBodyGyroMag-std()"          "Average-fBodyBodyGyroMag-meanFreq()"    
"Average-fBodyBodyGyroJerkMag-mean()"     "Average-fBodyBodyGyroJerkMag-std()"      "Average-fBodyBodyGyroJerkMag-meanFreq()"
	description: 79 variables for average of mean and standard deviation measures
	type: continuous numerc variable
	unit: NA	

About

Final assignment in coursera class "Getting and Cleaning Data" by Johns Hopkins University

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages