Giter Club home page Giter Club logo

ml-time-series's Introduction

Machine Learning techniques for time series classification

This repository shows different approaches to time series classification using machine learning techniques. In addition to comparing some of the most used machine learning models (Deep learning, Neural network, Support Vector Machine ...), we oppose two different types of input for some of these models: using the raw time series or using features extracted from the time series (statistical measures, frequency domain features, geometrical features... features detailed below).

In this repository we will use python's scientific package NumPy, some scikit-learn features and TensorFlow for convolutional neural networks and neural networks.

Machine Learning Approaches in this repository

The 6 different approaches in this repository are:

  • Convolutional Neural Network with raw data

  • k Nearest Neighbors (kNN) with raw data

  • k Nearest Neighbors with features

  • Neural Network with raw data

  • Neural Network with features

  • Support Vector Machine (SVM) with features

Time series data: Human Activity Recognition (HAR data)

The data set we use in this repository is a Human Activity Recognition database available for free here on UCI Machine Learning Repository. This data set consists in 3-axial accelerometer and gyroscope signals captured with a smartphone worn on the waist while performing 6 different activities:

  • Walking
  • Walking upstairs
  • Walking downstairs
  • Sitting
  • Standing
  • Laying

Each sample in the dataset is a 2.56s window sampled at a 50Hz rate which makes 6 x 128 readings per sample (3 accelerometer axis x,y,z and 3 gyroscope axis x,y,z). In this repository we will only use the 3 accelerometer axis x, y and z.

Below we plot examples of the time series for each activity:

Accelerometer walking Accelerometer walking upstairs Accelerometer walking downstairs Accelerometer sitting Accelerometer standing Accelerometer laying

The classification task here consists in recognizing the 6 activities given above. As explained in the introduction, we will either use the raw signals (plots above) or features extracted from these signals.

Features extraction

In some of the notebooks in this repository we will extract features from the time series and use them as input for the Machine Learning models. In these notebooks we will build helper functions to extract the desired features. We extract statistical and geometrical features from raw signals and jerk signals (acceleration first derivative), frequency domain features from raw signals and jerk signals. The full list of features is:

  • x,y and z raw signals : mean, max, min, standard deviation, skewness, kurtosis, interquartile range, median absolute deviation, area under curve, area under squared curve
  • x,y and z jerk signals (first derivative) : mean, max, min, standard deviation, skewness, kurtosis, interquartile range, median absolute deviation, area under curve, area under squared curve
  • x,y and z raw signals Discrete Fourrier Transform: mean, max, min, standard deviation, skewness, kurtosis, interquartile range, median absolute deviation, area under curve, area under squared curve, weighted mean frequency, 5 first DFT coefficients, 5 first local maxima of DFT coefficients and their corresponding frequencies.
  • x,y and z jerk signals Discrete Fourrier Transform: mean, max, min, standard deviation, skewness, kurtosis, interquartile range, median absolute deviation, area under curve, area under squared curve, weighted mean frequency, 5 first DFT coefficients, 5 first local maxima of DFT coefficients and their corresponding frequencies.
  • x,y and z correlation coefficients

ml-time-series's People

Contributors

jeandeducla avatar

Watchers

James Cloos 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.