Coder Social home page Coder Social logo

cleandata's Introduction

Run analysis script

The script starts by reading "features.txt" which contains the column names for the variables in train and test set. From the features it creates a logical vector which has TRUE value for all the variables we are interested in. The interesting variables are the ones which have either "mean" or "std" in their name.

Next the activity names are loaded from "activity_labels.txt" and stored to a vector. The vector at certain index maps the numeric values in "y_train.txt" and "y_test.txt" to factor value.

After loading the metadata the variables are loaded from "X_train.txt" and "X_test.txt". After loading these are catenated to form one dataset. These files have variable number of spaces between columns which is why sep="" parameter is given.

The full dataset is then given column names from the "features.txt" loaded earlier. Also the uninteresting columns are removed with the help of the logical vector created from the variable names.

Next the script loads the activity information and subject information from both train and test sets. These are then catenated together. The activities are mapped from numeric to factor values with the help of the vector created earlier from the "activity_labels.txt".

Finally the subject and activity information is combined with the full dataset and dataset is then outputted.

cleandata's People

Watchers

James Cloos avatar Mika Hirvikorpi 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.