Code Monkey home page Code Monkey logo

getting-cleaning-data's Introduction

Getting-Cleaning-Data

Coursera's Getting & Cleaning Data

Steps followed in generating the tidy dataset

  • Download the zip file in the current working directory
  • Unzip the file in the "UCI HAR Dataset" subfolder in the current working directory
  • Read the subject_train, X_train and y_train files in train subfolder within "UCI HAR Dataset" folder into separate data frames
  • Read the subject_test, X_test and y_test files in test subfolder within "UCI HAR Dataset" folder into separate data frames
  • Union these 6 data frames into 3 data frames named subjects.df, features.df and activtites.df
  • Read the features.txt and activity_labels.txt into separate data frames named feature.labels and activity.labels
  • Remove the special characters (open bracket, close bracket and hyphen) in the feature.labels data frame which represents mean or standard deviation (contains 'mean' or 'std' in it)
  • Name the features.df with the clensed values of feature.labels data frame
  • Name the subjects.df and activities.df properly
  • Merge activities.df and activity.labels by the key column
  • Combine features.df, subjects.df and activities.df data frames into a new data frame
  • Select only the attributes which are measure of mean or standard deviation (contains 'mean' or 'std' in it)
  • Convert the subject id and activity description as factors
  • Create the tidy data frame by calculating the mean of all the columns grouped by subject id and activity description
  • Write the data of this data frame into tidy.txt file

getting-cleaning-data's People

Contributors

parrad avatar

Watchers

 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.