Coder Social home page Coder Social logo

getandcleandatamooc-prj1's Introduction

How the script works

  1. Load all variable names from the file features.txt in the variable allColumnNames
  2. Create a vector relevantColumnNames containing only variables relevant from the exercise, by filtering for names containing substrings "mean()" or "std()"
  3. Load activity labels in the dataframe activityLabels
  4. Load all data files in separate dataframes, all with the same number of records:
    • y_test.txt / y_train.txt containing activity code by record
    • X_test.txt / X_train.txt containing all preprocessed sensor signals by record
    • subject_test.txt / subject_train.txt containing the subject code to which the record is refering to
  5. Assign names to variables in each dataframe --> ASSIGNMENT #4
  6. Merge activity code and subject code dataframes in the sensor signals dataframes X_test / X_train
  7. Join train and test dataframes in totalObservations data frame --> ASSIGNMENT #1
  8. Subset totalObservations to keep only relevant columns --> ASSIGNMENT #2
  9. Add meaningful labels to activity column by merging the totalObservations dataframe with the activityLabels dataframe using the activityCode as key --> ASSIGNMENT #3
  10. Create new dataset ("aggregation") with average of each variable for each activity and each subject --> ASSIGNMENT #5
    • Define by which fields data will be aggregated creating a list containing subjectCode and activityLabel variable names
    • Aggregate data using function aggregate
    • Remove redundant variables
    • Write in output file

Raw data files used

Directory structure


  ~ working directory
   |__ UCI HAR Dataset (folder)
   |  |__ activity_labels.txt
   |  |__ features.txt
   |  |__ features_info.txt
   |  |__ README.txt
   |  |  
   |  |__ test (folder)
   |  |  |__ subject_test.txt
   |  |  |__ X_test.txt
   |  |  |__ y_test.txt
   |  |  |__ Inertial Signals (folder)
   |  |     |__ -- raw data from signal sensors --
   |  |
   |  |__ train (folder)
   |     |__ subject_train.txt
   |     |__ X_train.txt
   |     |__ y_train.txt
   |     |__ Inertial Signals (folder)
   |        |__ -- raw data from signal sensors --
   |   
   |
   |__ script (folder)
      |_ run_analysis.R
      |_ codebook.md

getandcleandatamooc-prj1's People

Contributors

erpreciso avatar

Watchers

 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.