Giter VIP home page Giter VIP logo

human-activity-recognition-smartphone-sensors's Introduction

1. Introduction :

A modern phone comes with variety of sensors which record data for every second of their active life. The aim of Human Activity Recognition research project which built this database from the recordings of 30 subjects performing activities of daily living (ADL) while carrying a waist-mounted smartphone with embedded inertial sensors. The complete data & related papers can be accessed at : UCI ML Repository

2. Attribute Information (as it is):

For each record in the dataset it is provided:

  • Triaxial acceleration from the accelerometer (total acceleration) and the estimated body acceleration.
  • Triaxial Angular velocity from the gyroscope.
  • A 561-feature vector with time and frequency domain variables.
  • Its activity label.
  • An identifier of the subject who carried out the experiment.

3. Goal:

  • Algorithmic feature selection
  • Build a classifier for identifying user activity from the given data
  • Report our results for a non-academic audience

4. Our Approach:

  • Exploratory analysis:
  • We started with analyzing individual variables and were quickly overwhelmed by the sheer number of possible variations for combinations of these variables to look individually and actually make sense of it all

  • So, we did basic variance checks for each variable : if the variance of a given variable is very low, that variable is likely to have low impact on the output class. This is not a hard rule & we intend to use it in conjunction with other results if needed.

  • Variable Importance

  • We used variable importance from random forest model creation phase as an indicator of whether we should keep a particular variable in our model or remove it.

Variable Importance -top 5

Variable Importance -top 5

  • More about feature importance in random forest using scikit-learn here

5. Code description

  • Exploratory analysis notebook:

    • Correlation matrix
    • Variance check
    • Distribution plots
    • Detailed statistics for each variable
  • Classification model notebook:

    • We start with our raw dataset (samsungData.Rda)
    • Split this dataset into train & test (70/30)
    • Build our base model using all 561 variables
    • Select variables using variable importance scores
    • Iterate over this process till final model
    • During each iteration, we use oob score to gauge generalizability of our model
Correlation Matrix

Correlation Matrix

  • PCA notebook

  • An attempt at looking all 561 variables using principle components

Confusion matrix for the final model

Confusion matrix for the final model

Read more about Random Forests, Bootstrap Aggregating & Variable importance scores here.

human-activity-recognition-smartphone-sensors's People

Contributors

nilesh-patil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.