All Projects → markdregan → K Nearest Neighbors With Dynamic Time Warping

markdregan / K Nearest Neighbors With Dynamic Time Warping

Python implementation of KNN and DTW classification algorithm

Projects that are alternatives of or similar to K Nearest Neighbors With Dynamic Time Warping

Tsmoothie
A python library for time-series smoothing and outlier detection in a vectorized way.
Stars: ✭ 109 (-81.95%)
Mutual labels:  jupyter-notebook, timeseries
Pastas
🍝 Pastas is an open-source Python framework for the analysis of hydrological time series.
Stars: ✭ 155 (-74.34%)
Mutual labels:  jupyter-notebook, timeseries
Analyzing neural time series
python implementations of Analyzing Neural Time Series Textbook
Stars: ✭ 117 (-80.63%)
Mutual labels:  jupyter-notebook, timeseries
Kaggle Web Traffic Time Series Forecasting
Solution to Kaggle - Web Traffic Time Series Forecasting
Stars: ✭ 29 (-95.2%)
Mutual labels:  jupyter-notebook, timeseries
Transformer
Implementation of Transformer model (originally from Attention is All You Need) applied to Time Series.
Stars: ✭ 273 (-54.8%)
Mutual labels:  jupyter-notebook, timeseries
Stingray
Anything can happen in the next half hour (including spectral timing made easy)!
Stars: ✭ 94 (-84.44%)
Mutual labels:  jupyter-notebook, timeseries
Simplestockanalysispython
Stock Analysis Tutorial in Python
Stars: ✭ 126 (-79.14%)
Mutual labels:  jupyter-notebook, timeseries
Anomaly detection
This is a times series anomaly detection algorithm, implemented in Python, for catching multiple anomalies. It uses a moving average with an extreme student deviate (ESD) test to detect anomalous points.
Stars: ✭ 50 (-91.72%)
Mutual labels:  jupyter-notebook, timeseries
Timeseries fastai
fastai V2 implementation of Timeseries classification papers.
Stars: ✭ 221 (-63.41%)
Mutual labels:  jupyter-notebook, timeseries
Tcdf
Temporal Causal Discovery Framework (PyTorch): discovering causal relationships between time series
Stars: ✭ 217 (-64.07%)
Mutual labels:  jupyter-notebook, timeseries
Kaggle Web Traffic
1st place solution
Stars: ✭ 1,641 (+171.69%)
Mutual labels:  jupyter-notebook, timeseries
Tsai
Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai
Stars: ✭ 407 (-32.62%)
Mutual labels:  jupyter-notebook, timeseries
Timesynth
A Multipurpose Library for Synthetic Time Series Generation in Python
Stars: ✭ 170 (-71.85%)
Mutual labels:  jupyter-notebook, timeseries
Deep Reinforcement Learning
Repo for the Deep Reinforcement Learning Nanodegree program
Stars: ✭ 4,012 (+564.24%)
Mutual labels:  dynamic-programming, jupyter-notebook
Reinforcement learning tutorial with demo
Reinforcement Learning Tutorial with Demo: DP (Policy and Value Iteration), Monte Carlo, TD Learning (SARSA, QLearning), Function Approximation, Policy Gradient, DQN, Imitation, Meta Learning, Papers, Courses, etc..
Stars: ✭ 442 (-26.82%)
Mutual labels:  dynamic-programming, jupyter-notebook
Python Deepdive
Python Deep Dive Course - Accompanying Materials
Stars: ✭ 590 (-2.32%)
Mutual labels:  jupyter-notebook
Neuraltalk2
Efficient Image Captioning code in Torch, runs on GPU
Stars: ✭ 5,263 (+771.36%)
Mutual labels:  jupyter-notebook
Kobert
Korean BERT pre-trained cased (KoBERT)
Stars: ✭ 591 (-2.15%)
Mutual labels:  jupyter-notebook
Telemanom
A framework for using LSTMs to detect anomalies in multivariate time series data. Includes spacecraft anomaly data and experiments from the Mars Science Laboratory and SMAP missions.
Stars: ✭ 589 (-2.48%)
Mutual labels:  jupyter-notebook
Fastai dev
fast.ai early development experiments
Stars: ✭ 604 (+0%)
Mutual labels:  jupyter-notebook

K Nearest Neighbors & Dynamic Time Warping

View IPython notebook

When it comes to building a classification algorithm, analysts have a broad range of open source options to choose from. However, for time series classification, there are less out-of-the box solutions.

I began researching the domain of time series classification and was intrigued by a recommended technique called K Nearest Neighbors and Dynamic Time Warping. A meta analysis completed by Mitsa (2010) suggests that when it comes to timeseries classification, 1 Nearest Neighbor (K=1) and Dynamic Timewarping is very difficult to beat [1].

This repo contains a python implementation (and IPython notebook) of KNN & DTW classification algorithm.

The following IPython notebook evaluates the KNN and DTW classifer by using it to classify human activities (sitting, walking, lying) when given timeseries data from a smart phones gyroscope and accelerometer (HAR dataset).

Human Activity Recognition Dataset

The Human Activity Recognition Dataset (HAR) dataset is chosen to test the classification performance of DTW & KNN [3].

The experiments were carried out with a group of 30 volunteers within an age bracket of 19-48 years. Each person performed six activities (walking, walking upstairs, walking downstairs, sitting, standing and laying) wearing a smartphone (Samsung Galaxy S II) on the waist. Using its embedded accelerometer and gyroscope, we captured 3-axial linear acceleration and 3-axial angular velocity at a constant rate of 50Hz. The experiments have been video-recorded to label the data manually.

References

  1. Mitsa (2010). Temporal Data Mining (Chapter on Temporal Classification).
  2. Xi (2006). Fast Time Series Classification Using Numerosity Reduction.
  3. Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra and Jorge L. Reyes-Ortiz. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. International Workshop of Ambient Assisted Living (IWAAL 2012). Vitoria-Gasteiz, Spain. Dec 2012. Read Paper

Credit

  • The progressbar used in the DtwKnn() class was taken from PYMC
  • The matplotlib style and IPython notebook was taken from Cameron Davidson-Pilon's excelent "Bayesian Methods for Hackers"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].