Skip to content

akaEmma/datasciencecoursera

Repository files navigation

==================================================================
Tidied and Summarized Human Activity Recognition Using Smartphones Dataset
Version 1.0
==================================================================
From dataset created by 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.
activityrecognition@smartlab.ws
www.smartlab.ws
Tidied by Sheila Braun
==================================================================

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. 


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

- 'README.txt' (you're reading it)

- 'tidy_dt.txt' tidied and summarize data from original authors

- 'run_analysis.R' is the script used to tidy the data set

The 'run_analysis.R' script does the following:

1. Load x test and training data into separate tables
2. Bind the test and training set together to form one data table (adding their rows together.)
3. Use the features text file to put the colnames in place so the data tabel makes sense. 
4. Pick out only the measures with mean or std and store in a var called "chosen_ones"
5. Take a subset of the main data table using chosens_ones as a parameter
6. Standardize column names thus:
        "mean" to "Mean"
        "std" to "Std"
        ^t to "Time"
        ^f to "Frequency"
        "()" to ""
        "-" to ""
        "BodyBody" to "Body"
        "^" to "MeanOf"
7. Merge the two activity data sets, first with each other (adding rows)
8. ... and then with the main data table (adding columns)
9. Give the merged activity data sets some labels, as provided in "activities.txt"
10. Then merge them with the main data table
11. Merge the "subject" training and test sets (adding rows)
12. Add them as new columns to the main data set
13. Load the dplyr package
14. Pipe the main data set through grouping (by subject, then by activity) and summarizing all, returning means
15. Store result in a new data table called "avg_dt".
16. Save the new data table to a file called "tidy_dt.txt"

This script resulted in a data table with the following structure:

Classes ‘grouped_df’, ‘tbl_df’, ‘tbl’ and 'data.frame':	180 obs. of  68 variables:
 $ Subject                           : int  1 1 1 1 1 1 2 2 2 2 ...
 $ Activity                          : Factor w/ 6 levels "LAYING","SITTING",..: 1 2 3 4 5 6 1 2 3 4 ...
 $ MeanOfTimeBodyAccMeanX            : num  0.222 0.261 0.279 0.277 0.289 ...
 $ MeanOfTimeBodyAccMeanY            : num  -0.04051 -0.00131 -0.01614 -0.01738 -0.00992 ...
 $ MeanOfTimeBodyAccMeanZ            : num  -0.113 -0.105 -0.111 -0.111 -0.108 ...
 $ MeanOfTimeBodyAccStdX             : num  -0.928 -0.977 -0.996 -0.284 0.03 ...
 $ MeanOfTimeBodyAccStdY             : num  -0.8368 -0.9226 -0.9732 0.1145 -0.0319 ...
 $ MeanOfTimeBodyAccStdZ             : num  -0.826 -0.94 -0.98 -0.26 -0.23 ...
 $ MeanOfTimeGravityAccMeanX         : num  -0.249 0.832 0.943 0.935 0.932 ...
 $ MeanOfTimeGravityAccMeanY         : num  0.706 0.204 -0.273 -0.282 -0.267 ...
 $ MeanOfTimeGravityAccMeanZ         : num  0.4458 0.332 0.0135 -0.0681 -0.0621 ...
 $ MeanOfTimeGravityAccStdX          : num  -0.897 -0.968 -0.994 -0.977 -0.951 ...
 $ MeanOfTimeGravityAccStdY          : num  -0.908 -0.936 -0.981 -0.971 -0.937 ...
 $ MeanOfTimeGravityAccStdZ          : num  -0.852 -0.949 -0.976 -0.948 -0.896 ...
 $ MeanOfTimeBodyAccJerkMeanX        : num  0.0811 0.0775 0.0754 0.074 0.0542 ...
 $ MeanOfTimeBodyAccJerkMeanY        : num  0.003838 -0.000619 0.007976 0.028272 0.02965 ...
 $ MeanOfTimeBodyAccJerkMeanZ        : num  0.01083 -0.00337 -0.00369 -0.00417 -0.01097 ...
 $ MeanOfTimeBodyAccJerkStdX         : num  -0.9585 -0.9864 -0.9946 -0.1136 -0.0123 ...
 $ MeanOfTimeBodyAccJerkStdY         : num  -0.924 -0.981 -0.986 0.067 -0.102 ...
 $ MeanOfTimeBodyAccJerkStdZ         : num  -0.955 -0.988 -0.992 -0.503 -0.346 ...
 $ MeanOfTimeBodyGyroMeanX           : num  -0.0166 -0.0454 -0.024 -0.0418 -0.0351 ...
 $ MeanOfTimeBodyGyroMeanY           : num  -0.0645 -0.0919 -0.0594 -0.0695 -0.0909 ...
 $ MeanOfTimeBodyGyroMeanZ           : num  0.1487 0.0629 0.0748 0.0849 0.0901 ...
 $ MeanOfTimeBodyGyroStdX            : num  -0.874 -0.977 -0.987 -0.474 -0.458 ...
 $ MeanOfTimeBodyGyroStdY            : num  -0.9511 -0.9665 -0.9877 -0.0546 -0.1263 ...
 $ MeanOfTimeBodyGyroStdZ            : num  -0.908 -0.941 -0.981 -0.344 -0.125 ...
 $ MeanOfTimeBodyGyroJerkMeanX       : num  -0.1073 -0.0937 -0.0996 -0.09 -0.074 ...
 $ MeanOfTimeBodyGyroJerkMeanY       : num  -0.0415 -0.0402 -0.0441 -0.0398 -0.044 ...
 $ MeanOfTimeBodyGyroJerkMeanZ       : num  -0.0741 -0.0467 -0.049 -0.0461 -0.027 ...
 $ MeanOfTimeBodyGyroJerkStdX        : num  -0.919 -0.992 -0.993 -0.207 -0.487 ...
 $ MeanOfTimeBodyGyroJerkStdY        : num  -0.968 -0.99 -0.995 -0.304 -0.239 ...
 $ MeanOfTimeBodyGyroJerkStdZ        : num  -0.958 -0.988 -0.992 -0.404 -0.269 ...
 $ MeanOfTimeBodyAccMagMean          : num  -0.8419 -0.9485 -0.9843 -0.137 0.0272 ...
 $ MeanOfTimeBodyAccMagStd           : num  -0.7951 -0.9271 -0.9819 -0.2197 0.0199 ...
 $ MeanOfTimeGravityAccMagMean       : num  -0.8419 -0.9485 -0.9843 -0.137 0.0272 ...
 $ MeanOfTimeGravityAccMagStd        : num  -0.7951 -0.9271 -0.9819 -0.2197 0.0199 ...
 $ MeanOfTimeBodyAccJerkMagMean      : num  -0.9544 -0.9874 -0.9924 -0.1414 -0.0894 ...
 $ MeanOfTimeBodyAccJerkMagStd       : num  -0.9282 -0.9841 -0.9931 -0.0745 -0.0258 ...
 $ MeanOfTimeBodyGyroMagMean         : num  -0.8748 -0.9309 -0.9765 -0.161 -0.0757 ...
 $ MeanOfTimeBodyGyroMagStd          : num  -0.819 -0.935 -0.979 -0.187 -0.226 ...
 $ MeanOfTimeBodyGyroJerkMagMean     : num  -0.963 -0.992 -0.995 -0.299 -0.295 ...
 $ MeanOfTimeBodyGyroJerkMagStd      : num  -0.936 -0.988 -0.995 -0.325 -0.307 ...
 $ MeanOfFrequencyBodyAccMeanX       : num  -0.9391 -0.9796 -0.9952 -0.2028 0.0382 ...
 $ MeanOfFrequencyBodyAccMeanY       : num  -0.86707 -0.94408 -0.97707 0.08971 0.00155 ...
 $ MeanOfFrequencyBodyAccMeanZ       : num  -0.883 -0.959 -0.985 -0.332 -0.226 ...
 $ MeanOfFrequencyBodyAccStdX        : num  -0.9244 -0.9764 -0.996 -0.3191 0.0243 ...
 $ MeanOfFrequencyBodyAccStdY        : num  -0.834 -0.917 -0.972 0.056 -0.113 ...
 $ MeanOfFrequencyBodyAccStdZ        : num  -0.813 -0.934 -0.978 -0.28 -0.298 ...
 $ MeanOfFrequencyBodyAccJerkMeanX   : num  -0.9571 -0.9866 -0.9946 -0.1705 -0.0277 ...
 $ MeanOfFrequencyBodyAccJerkMeanY   : num  -0.9225 -0.9816 -0.9854 -0.0352 -0.1287 ...
 $ MeanOfFrequencyBodyAccJerkMeanZ   : num  -0.948 -0.986 -0.991 -0.469 -0.288 ...
 $ MeanOfFrequencyBodyAccJerkStdX    : num  -0.9642 -0.9875 -0.9951 -0.1336 -0.0863 ...
 $ MeanOfFrequencyBodyAccJerkStdY    : num  -0.932 -0.983 -0.987 0.107 -0.135 ...
 $ MeanOfFrequencyBodyAccJerkStdZ    : num  -0.961 -0.988 -0.992 -0.535 -0.402 ...
 $ MeanOfFrequencyBodyGyroMeanX      : num  -0.85 -0.976 -0.986 -0.339 -0.352 ...
 $ MeanOfFrequencyBodyGyroMeanY      : num  -0.9522 -0.9758 -0.989 -0.1031 -0.0557 ...
 $ MeanOfFrequencyBodyGyroMeanZ      : num  -0.9093 -0.9513 -0.9808 -0.2559 -0.0319 ...
 $ MeanOfFrequencyBodyGyroStdX       : num  -0.882 -0.978 -0.987 -0.517 -0.495 ...
 $ MeanOfFrequencyBodyGyroStdY       : num  -0.9512 -0.9623 -0.9871 -0.0335 -0.1814 ...
 $ MeanOfFrequencyBodyGyroStdZ       : num  -0.917 -0.944 -0.982 -0.437 -0.238 ...
 $ MeanOfFrequencyBodyAccMagMean     : num  -0.8618 -0.9478 -0.9854 -0.1286 0.0966 ...
 $ MeanOfFrequencyBodyAccMagStd      : num  -0.798 -0.928 -0.982 -0.398 -0.187 ...
 $ MeanOfFrequencyBodyAccJerkMagMean : num  -0.9333 -0.9853 -0.9925 -0.0571 0.0262 ...
 $ MeanOfFrequencyBodyAccJerkMagStd  : num  -0.922 -0.982 -0.993 -0.103 -0.104 ...
 $ MeanOfFrequencyBodyGyroMagMean    : num  -0.862 -0.958 -0.985 -0.199 -0.186 ...
 $ MeanOfFrequencyBodyGyroMagStd     : num  -0.824 -0.932 -0.978 -0.321 -0.398 ...
 $ MeanOfFrequencyBodyGyroJerkMagMean: num  -0.942 -0.99 -0.995 -0.319 -0.282 ...
 $ MeanOfFrequencyBodyGyroJerkMagStd : num  -0.933 -0.987 -0.995 -0.382 -0.392 ...
 - attr(*, "vars")= chr "Subject"
 - attr(*, "drop")= logi TRUE


For more information about the dataset that was the parent of this dataset contact: activityrecognition@smartlab.ws

License:
========
Use of this dataset in publications must be acknowledged by referencing the following publication [1] 

[1] Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra and Jorge L. Reyes-Ortiz. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. International Workshop of Ambient Assisted Living (IWAAL 2012). Vitoria-Gasteiz, Spain. Dec 2012

This dataset is distributed AS-IS and no responsibility implied or explicit can be addressed to the authors or their institutions for its use or misuse. Any commercial use is prohibited.

Jorge L. Reyes-Ortiz, Alessandro Ghio, Luca Oneto, Davide Anguita. November 2012.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages