Code Monkey home page Code Monkey logo

gettingandcleaningdata's Introduction

Readme

Project Description

This is a codebook for the course project "Getting and Cleaning Data"

##Collection of the raw data The data was downloaded from http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones and unzipped. The link to the data: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip.

##Creating the tidy datafile

Required R packages: data.table, dplyr

###Guide to create the tidy data file

  1. download the data
  2. unzip
  3. read features names from ./UCI HAR Dataset/features.txt
  4. add "SubjectId" and "Activity" to the list of features
  5. collect activity data table from ./UCI HAR Dataset/activity_labels.txt
  6. read 3 train datasets from ./UCI HAR Dataset/train and combine into one
  7. read 3 test datasets from ./UCI HAR Dataset/test and combine into one
  8. combine train and test datasets into one
  9. name features for the result from the list of step 4
  10. remove dublicates in features
  11. filter features only with mean() and std(). Features with meanFreq() were removed because they weighted averages of the frequency components. We are interested only in unweighted means. Features angle() that contained mean/std values in arguments were also removed. They do not represent a mean/std value of a measurement.
  12. rename numbers in "Activity" by activity names from the list of step 5
  13. label the data set with descriptive variable names: -mean -> Mean, -std -> Std, JerkMag -> JerkMagnitude, AcckMag -> AcckMagnitude, GyroMag -> GyroMagnitude, t -> time, f -> freq
  14. create a dataset with the average of each variable for each activity and each subject
  15. write result into txt file

##Description of the variables in the summaryData.txt file The features selected for this database come from the accelerometer and gyroscope 3-axial raw signals (timeAcc-XYZ and timeGyro-XYZ). The acceleration signal was then separated into body and gravity acceleration signals (BodyAcc and GravityAcc). Subsequently, the body linear acceleration and angular velocity were derived in time to obtain Jerk signals (AccJerk and GyroJerk). Also the magnitude of these three-dimensional signals were calculated (AccMagnitude, JerkMagnitude, GyroMagnitude). A Fast Fourier Transform (FFT) was applied to some of these signals producing (freq).

Mean: Mean value, Std: Standard deviation

gettingandcleaningdata's People

Contributors

drychkov avatar

Watchers

 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.