Skip to content

Classify common human activities from accelerometer data.

Notifications You must be signed in to change notification settings

ghayth82/activity-recognizer

 
 

Repository files navigation

Activity Classification from Accelerometer Data

Project Description

Dataset

The dataset for this project can be found in the UCI Machine Learning Repository. The dataset consists of 15 participants, each of whom performed 7 different activities. The activities are as follows:

  1. Working at Computer
  2. Standing Up, Walking and Going Up/Down Stairs
  3. Standing
  4. Walking
  5. Going Up/Down Stairs
  6. Walking and Talking with Someone
  7. Talking while Standing

The data is provided a series of measuremeants of the x, y, and z components of acceleration.

The extracted feature data can be found in data/data.csv. See the UCI link for raw files.

Goal

Ultimatley, we would like to use the accelerometer data to determine which activity someone is performing. We would like to extract useful patterns from the data that can be used as distinguishing features for a classification algorithm.

Contents

feature_extraction.py

Reads in the initial time series data and converts it into feature vectors. Current features include

  • mean (x, y, z)
  • standard deviation (x, y, z)
  • dominant frequency (x, y, z)

classification.py

Creates two classifiers

  • k_means
  • decision_tree

evaluation.py

Uses two metrics

  • accuracy_score
  • fowlkes_mallows

visualize.py

Create all visuals including acceleration graphs and decision tree representations.

utils.py

Helper functions

main.py

Run the program

Getting Started

Dependencies

  • numpy
  • pandas
  • matplotlib
  • sklearn
  • graphviz

Run the Code

To see the results of this analysis, run the following from a command prompt:

python main.py

NOTE: It may take some time to complete since it is averaging the results of ten different models

About

Classify common human activities from accelerometer data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%