Git Product home page Git Product logo

courseproject's Introduction

How run_analysis works

  1. We start from reading the files. We assume data files are already downloaded, unzipped and they are in working directory. data files can be obtained from following link: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones

  2. First we read training data set and then test data set. After we read all files, we start to build data set.

  3. First thing we do is we combing train data. In this data set, subject.train refere to subjects of training data set. According to the given discription we have 30 subjects. Then y.train refers to their activities. Again they do 6 activides coded by 1-6. Next x.train contain the data of measurements. We combine these data as column wise

  4. We do the step(3) again for test data.

  5. Now we combine train data and test data together to obtain complete data set. This is done using row bind.

  6. Next we extracts measurements on the mean and standard deviation of each measurement. To do that we check whether variable name contains "-mean()" or "-std()"

  7. Next we read activity names from "activity_label.txt" file and use those activity labels to rename activities(instead of "1-6" naming convention now we have disriptive activity set).

  8. next we need to label variables with disriptive names.

  9. to do that first we seperate varaible name to two part. Seperation point is first occurance of "-". For example "tBodyAcc-mean()-X" seperate into "tBodyAcc" and "-mean()-X"

  10. We assign first part to "nondiscpart1" varaible and second part to "nondiscpart2" variable

  11. Next we take "nondiscpart2" varaible. Which contain elemnt like "-mean()-X", "-std()". We remove "()", "-" and substitute "X axis" for "X", "mean" by "meanof", "std" by "stdof",etc.

  12. After that we take "nondiscpart1" varaible. We do foolowing assignments. i. ACC ----Accelaration ii Gyro --Gyroscope iii t-Timedomain iv f-FreqDomain v. we correct typo "BodyBody" by removing repetition vi. We bring "Mag" to front of varaible and now it read "Magnitudeof" vii We add "Signals" to the end

  13. We concatenate nondiscpart1 and nondiscpart2 to get full discriptive lables

  14. Then we assign that as names of data set(except first two labels("subject" and "Activity"))

  15. Then we take average of each variable for each activity and each subject

  16. We write the data set into current directory as text file.

courseproject's People

Contributors

cvajira 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.