Git Product home page Git Product logo

cleaning's Introduction

The script expects the data to be in a folder called "UCI HAR Dataset" in the current working directory. It reads first test data and then rbinds the train data. So all datasets have the test data before the training data and the rows correspond.

It reads the test and train X data with the descriptive variable names specified in "features.txt", then it keeps the variables that have the string "mean..." or "std..." in the name and discards all the others.

Next, it adds the activities, reading the activity codes from test and train data and joining it with the names defined in "activity_labels.txt". The subject is also read and added as a column.

Finally, the table is melted and dcasted in order to have the mean by each group. The groups are defined by a new variable resulting from concatenating the subject and the activity.

The resulting dataset has these variables. The subjectActivity variable represents the combination of subject and activity, the rest of the variables are the mean for the original ones:

[1] "subjectActivity"
[2] "tBodyAcc.mean...X"
[3] "tBodyAcc.mean...Y"
[4] "tBodyAcc.mean...Z"
[5] "tBodyAcc.std...X"
[6] "tBodyAcc.std...Y"
[7] "tBodyAcc.std...Z"
[8] "tGravityAcc.mean...X"
[9] "tGravityAcc.mean...Y"
[10] "tGravityAcc.mean...Z"
[11] "tGravityAcc.std...X"
[12] "tGravityAcc.std...Y"
[13] "tGravityAcc.std...Z"
[14] "tBodyAccJerk.mean...X" [15] "tBodyAccJerk.mean...Y" [16] "tBodyAccJerk.mean...Z" [17] "tBodyAccJerk.std...X"
[18] "tBodyAccJerk.std...Y"
[19] "tBodyAccJerk.std...Z"
[20] "tBodyGyro.mean...X"
[21] "tBodyGyro.mean...Y"
[22] "tBodyGyro.mean...Z"
[23] "tBodyGyro.std...X"
[24] "tBodyGyro.std...Y"
[25] "tBodyGyro.std...Z"
[26] "tBodyGyroJerk.mean...X" [27] "tBodyGyroJerk.mean...Y" [28] "tBodyGyroJerk.mean...Z" [29] "tBodyGyroJerk.std...X" [30] "tBodyGyroJerk.std...Y" [31] "tBodyGyroJerk.std...Z" [32] "fBodyAcc.mean...X"
[33] "fBodyAcc.mean...Y"
[34] "fBodyAcc.mean...Z"
[35] "fBodyAcc.std...X"
[36] "fBodyAcc.std...Y"
[37] "fBodyAcc.std...Z"
[38] "fBodyAccJerk.mean...X" [39] "fBodyAccJerk.mean...Y" [40] "fBodyAccJerk.mean...Z" [41] "fBodyAccJerk.std...X"
[42] "fBodyAccJerk.std...Y"
[43] "fBodyAccJerk.std...Z"
[44] "fBodyGyro.mean...X"
[45] "fBodyGyro.mean...Y"
[46] "fBodyGyro.mean...Z"
[47] "fBodyGyro.std...X"
[48] "fBodyGyro.std...Y"
[49] "fBodyGyro.std...Z"

cleaning's People

Watchers

James Cloos avatar Fernando González 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.