Git Product home page Git Product logo

uci-human-activity-recognition---data-gathering-cleaning-project's Introduction

UCI HAR Dataset, Data Gathering & Cleaning Project

This project was completed as part of the Getting & Cleaning Data Course within the Data Science Specialization offered by Coursera.

The goal of the project was to utilize the UCI HAR motion sensor dataset folder to demonstrate skills in cleaning and manipulating to create a final tidy dataset ready for analysis.

run_analysis.R script: This script produces a tidy data set containing the means of select body sensor variables from the UCI HAR dataset, listed by subject id and activity id.

SCRIPT STEPS:
Preliminary

  • run library() on data.table and reshape2 to load relevant R functions

Downloading

Reading tables and identifying the select features to pull into the dataset:

  • Using read.table(), the desired features from the features vector set is extracted by matching the literals 'mean' or 'std' to the features.txt data. These desired features will be used later in subsetting the final train + test data set.

Reading all data

  • all relevant data from the train and test sets are read and cbinded, and both train and test datasets are then rbinded to produce a complete dataset.
  • However, from the X_train.txt and X_test.txt files, the only columns selected are the ones that have been identified by the 'desiredfeatures' variable created above.

Melting & Casting

  • The data is reshaped using melt() by the Subject & Activity IDs
  • The final data set is then set as a result of the dcast() function on our newly reshaped data, and we use the 'mean' argument to produce the means of each wanted features based on the subject ID and activity ID.
  • This tidy set is then written to a text file called 'tidy.txt'

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.