The data set that this code book pertains to is located in the tidy_data.txt file of this repository.
See the README.md file of this repository for background information on this data set.
The structure of the data set is described in the Data section, its variables are listed in the Variables section, and the transformations that were carried out to obtain the data set based on the source data are presented in the Transformations section.
The tidy_data.txt data file is a text file, containing space-separated values.
The first row contains the names of the variables, which are listed and described in the Variables section, and the following rows contain the values of these variables.
Each row contains, for a given subject and activity, 79 averaged signal measurements.
-
subjectSubject identifier, integer, ranges from 1 to 30.
-
activityActivity identifier, string with 6 possible values:
WALKING: subject was walkingWALKING_UPSTAIRS: subject was walking upstairsWALKING_DOWNSTAIRS: subject was walking downstairsSITTING: subject was sittingSTANDING: subject was standingLAYING: subject was laying
All measurements are floating-point values, normalised and bounded within [-1,1].
Prior to normalisation, acceleration measurements (variables containing Accelerometer) were made in g's (9.81 m.s⁻²) and gyroscope measurements (variables containing Gyroscope) were made in radians per second (rad.s⁻¹).
Magnitudes of three-dimensional signals (variables containing Magnitude) were calculated using the Euclidean norm.
The measurements are classified in two domains:
-
Time-domain signals (variables prefixed by
timeDomain), resulting from the capture of accelerometer and gyroscope raw signals. -
Frequency-domain signals (variables prefixed by
frequencyDomain), resulting from the application of a Fast Fourier Transform (FFT) to some of the time-domain signals.
-
Average time-domain body acceleration in the X, Y and Z directions:
timeDomainBodyAccelerometerMeanXtimeDomainBodyAccelerometerMeanYtimeDomainBodyAccelerometerMeanZ
-
Standard deviation of the time-domain body acceleration in the X, Y and Z directions:
timeDomainBodyAccelerometerStandardDeviationXtimeDomainBodyAccelerometerStandardDeviationYtimeDomainBodyAccelerometerStandardDeviationZ
-
Average time-domain gravity acceleration in the X, Y and Z directions:
timeDomainGravityAccelerometerMeanXtimeDomainGravityAccelerometerMeanYtimeDomainGravityAccelerometerMeanZ
-
Standard deviation of the time-domain gravity acceleration in the X, Y and Z directions:
timeDomainGravityAccelerometerStandardDeviationXtimeDomainGravityAccelerometerStandardDeviationYtimeDomainGravityAccelerometerStandardDeviationZ
-
Average time-domain body acceleration jerk (derivation of the acceleration in time) in the X, Y and Z directions:
timeDomainBodyAccelerometerJerkMeanXtimeDomainBodyAccelerometerJerkMeanYtimeDomainBodyAccelerometerJerkMeanZ
-
Standard deviation of the time-domain body acceleration jerk (derivation of the acceleration in time) in the X, Y and Z directions:
timeDomainBodyAccelerometerJerkStandardDeviationXtimeDomainBodyAccelerometerJerkStandardDeviationYtimeDomainBodyAccelerometerJerkStandardDeviationZ
-
Average time-domain body angular velocity in the X, Y and Z directions:
timeDomainBodyGyroscopeMeanXtimeDomainBodyGyroscopeMeanYtimeDomainBodyGyroscopeMeanZ
-
Standard deviation of the time-domain body angular velocity in the X, Y and Z directions:
timeDomainBodyGyroscopeStandardDeviationXtimeDomainBodyGyroscopeStandardDeviationYtimeDomainBodyGyroscopeStandardDeviationZ
-
Average time-domain body angular velocity jerk (derivation of the angular velocity in time) in the X, Y and Z directions:
timeDomainBodyGyroscopeJerkMeanXtimeDomainBodyGyroscopeJerkMeanYtimeDomainBodyGyroscopeJerkMeanZ
-
Standard deviation of the time-domain body angular velocity jerk (derivation of the angular velocity in time) in the X, Y and Z directions:
timeDomainBodyGyroscopeJerkStandardDeviationXtimeDomainBodyGyroscopeJerkStandardDeviationYtimeDomainBodyGyroscopeJerkStandardDeviationZ
-
Average and standard deviation of the time-domain magnitude of body acceleration:
timeDomainBodyAccelerometerMagnitudeMeantimeDomainBodyAccelerometerMagnitudeStandardDeviation
-
Average and standard deviation of the time-domain magnitude of gravity acceleration:
timeDomainGravityAccelerometerMagnitudeMeantimeDomainGravityAccelerometerMagnitudeStandardDeviation
-
Average and standard deviation of the time-domain magnitude of body acceleration jerk (derivation of the acceleration in time):
timeDomainBodyAccelerometerJerkMagnitudeMeantimeDomainBodyAccelerometerJerkMagnitudeStandardDeviation
-
Average and standard deviation of the time-domain magnitude of body angular velocity:
timeDomainBodyGyroscopeMagnitudeMeantimeDomainBodyGyroscopeMagnitudeStandardDeviation
-
Average and standard deviation of the time-domain magnitude of body angular velocity jerk (derivation of the angular velocity in time):
timeDomainBodyGyroscopeJerkMagnitudeMeantimeDomainBodyGyroscopeJerkMagnitudeStandardDeviation
-
Average frequency-domain body acceleration in the X, Y and Z directions:
frequencyDomainBodyAccelerometerMeanXfrequencyDomainBodyAccelerometerMeanYfrequencyDomainBodyAccelerometerMeanZ
-
Standard deviation of the frequency-domain body acceleration in the X, Y and Z directions:
frequencyDomainBodyAccelerometerStandardDeviationXfrequencyDomainBodyAccelerometerStandardDeviationYfrequencyDomainBodyAccelerometerStandardDeviationZ
-
Weighted average of the frequency components of the frequency-domain body acceleration in the X, Y and Z directions:
frequencyDomainBodyAccelerometerMeanFrequencyXfrequencyDomainBodyAccelerometerMeanFrequencyYfrequencyDomainBodyAccelerometerMeanFrequencyZ
-
Average frequency-domain body acceleration jerk (derivation of the acceleration in time) in the X, Y and Z directions:
frequencyDomainBodyAccelerometerJerkMeanXfrequencyDomainBodyAccelerometerJerkMeanYfrequencyDomainBodyAccelerometerJerkMeanZ
-
Standard deviation of the frequency-domain body acceleration jerk (derivation of the acceleration in time) in the X, Y and Z directions:
frequencyDomainBodyAccelerometerJerkStandardDeviationXfrequencyDomainBodyAccelerometerJerkStandardDeviationYfrequencyDomainBodyAccelerometerJerkStandardDeviationZ
-
Weighted average of the frequency components of the frequency-domain body acceleration jerk (derivation of the acceleration in time) in the X, Y and Z directions:
frequencyDomainBodyAccelerometerJerkMeanFrequencyXfrequencyDomainBodyAccelerometerJerkMeanFrequencyYfrequencyDomainBodyAccelerometerJerkMeanFrequencyZ
-
Average frequency-domain body angular velocity in the X, Y and Z directions:
frequencyDomainBodyGyroscopeMeanXfrequencyDomainBodyGyroscopeMeanYfrequencyDomainBodyGyroscopeMeanZ
-
Standard deviation of the frequency-domain body angular velocity in the X, Y and Z directions:
frequencyDomainBodyGyroscopeStandardDeviationXfrequencyDomainBodyGyroscopeStandardDeviationYfrequencyDomainBodyGyroscopeStandardDeviationZ
-
Weighted average of the frequency components of the frequency-domain body angular velocity in the X, Y and Z directions:
frequencyDomainBodyGyroscopeMeanFrequencyXfrequencyDomainBodyGyroscopeMeanFrequencyYfrequencyDomainBodyGyroscopeMeanFrequencyZ
-
Average, standard deviation, and weighted average of the frequency components of the frequency-domain magnitude of body acceleration:
frequencyDomainBodyAccelerometerMagnitudeMeanfrequencyDomainBodyAccelerometerMagnitudeStandardDeviationfrequencyDomainBodyAccelerometerMagnitudeMeanFrequency
-
Average, standard deviation, and weighted average of the frequency components of the frequency-domain magnitude of body acceleration jerk (derivation of the acceleration in time):
frequencyDomainBodyAccelerometerJerkMagnitudeMeanfrequencyDomainBodyAccelerometerJerkMagnitudeStandardDeviationfrequencyDomainBodyAccelerometerJerkMagnitudeMeanFrequency
-
Average, standard deviation, and weighted average of the frequency components of the frequency-domain magnitude of body angular velocity:
frequencyDomainBodyGyroscopeMagnitudeMeanfrequencyDomainBodyGyroscopeMagnitudeStandardDeviationfrequencyDomainBodyGyroscopeMagnitudeMeanFrequency
-
Average, standard deviation, and weighted average of the frequency components of the frequency-domain magnitude of body angular velocity jerk (derivation of the angular velocity in time):
frequencyDomainBodyGyroscopeJerkMagnitudeMeanfrequencyDomainBodyGyroscopeJerkMagnitudeStandardDeviationfrequencyDomainBodyGyroscopeJerkMagnitudeMeanFrequency
The zip file containing the source data is located at https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip.
The following transformations were applied to the source data:
- The training and test sets were merged to create one data set.
- The measurements on the mean and standard deviation (i.e. signals containing the strings
meanandstd) were extracted for each measurement, and the others were discarded. - The activity identifiers (originally coded as integers between 1 and 6) were replaced with descriptive activity names (see Identifiers section).
- The variable names were replaced with descriptive variable names (e.g.
tBodyAcc-mean()-Xwas expanded totimeDomainBodyAccelerometerMeanX), using the following set of rules:- Special characters (i.e.
(,), and-) were removed - The initial
fandtwere expanded tofrequencyDomainandtimeDomainrespectively. Acc,Gyro,Mag,Freq,mean, andstdwere replaced withAccelerometer,Gyroscope,Magnitude,Frequency,Mean, andStandardDeviationrespectively.- Replaced (supposedly incorrect as per source's
features_info.txtfile)BodyBodywithBody.
- Special characters (i.e.
- From the data set in step 4, the final data set was created with the average of each variable for each activity and each subject.
The collection of the source data and the transformations listed above were implemented by the run_analysis.R R script (see README.md file for usage instructions).