ricardodeazambuja / DTW

Licence: CC0-1.0 license
Dynamic Time Warping in Python / C (using ctypes)

Programming Languages

Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to DTW

Tslearn
A machine learning toolkit dedicated to time-series data
Stars: ✭ 1,910 (+7246.15%)
Mutual labels:  time-series, dtw
pyRiemann
Python machine learning package based on sklearn API for multivariate data processing and statistical analysis of symmetric positive definite matrices via Riemannian geometry
Stars: ✭ 470 (+1707.69%)
Mutual labels:  time-series, neuroscience
Soft-DTW-Loss
PyTorch implementation of Soft-DTW: a Differentiable Loss Function for Time-Series in CUDA
Stars: ✭ 76 (+192.31%)
Mutual labels:  time-series, dtw
renewcast
Renewcast: Forecasting Renewable Electricity Generation in EU Countries.
Stars: ✭ 28 (+7.69%)
Mutual labels:  time-series
Matrix-Profile
A Java library for Matrix Profile
Stars: ✭ 14 (-46.15%)
Mutual labels:  time-series
mf-nav-data
Historical NAV/price/time-series data of mutual funds and popular benchmark indices in India
Stars: ✭ 29 (+11.54%)
Mutual labels:  time-series
ColeAnticevicNetPartition
Public release of The Cole-Anticevic Brain-wide Network Partition (CAB-NP)
Stars: ✭ 48 (+84.62%)
Mutual labels:  neuroscience
BrainPy
Brain Dynamics Programming in Python
Stars: ✭ 242 (+830.77%)
Mutual labels:  neuroscience
NEURON-UI
NEURON User Interface
Stars: ✭ 14 (-46.15%)
Mutual labels:  neuroscience
SCINet
Forecast time series and stock prices with SCINet
Stars: ✭ 28 (+7.69%)
Mutual labels:  time-series
orderbook modeling
Example of order book modeling.
Stars: ✭ 38 (+46.15%)
Mutual labels:  time-series
ecogVIS
Time series visualizer and data processing tools for Electrocorticography (ECoG) signals stored in NWB files, for Python.
Stars: ✭ 18 (-30.77%)
Mutual labels:  neuroscience
Shapley regressions
Statistical inference on machine learning or general non-parametric models
Stars: ✭ 37 (+42.31%)
Mutual labels:  time-series
notebooks
Code examples for pyFTS
Stars: ✭ 40 (+53.85%)
Mutual labels:  time-series
modeltime.ensemble
Time Series Ensemble Forecasting
Stars: ✭ 65 (+150%)
Mutual labels:  time-series
nidb
NeuroInformatics Database
Stars: ✭ 26 (+0%)
Mutual labels:  neuroscience
microprediction
If you can measure it, consider it predicted
Stars: ✭ 158 (+507.69%)
Mutual labels:  time-series
PlotTwist
PlotTwist - a web app for plotting and annotating time-series data
Stars: ✭ 21 (-19.23%)
Mutual labels:  time-series
brainlit
Method container for computational neuroscience on brains.
Stars: ✭ 20 (-23.08%)
Mutual labels:  neuroscience
ewstools
Python package for early warning signals (EWS) of bifurcations in time series data.
Stars: ✭ 29 (+11.54%)
Mutual labels:  time-series

DTW - Dynamic Time Warping in Python / C (using ctypes)

The Dynamic Time Warping (DTW)[1,2] is a time-normalisation algorithm initially designed to eliminate timing differences between two speech patterns. This normalisation, or correction, is done by warping the time axis of one time series to match the other. The correction (time warping) makes it easier to compare two signals in a similar way to the method human beings use[3].

DTW example Example of 2D trajectory-matching generated by the DTW method. Although looking perfect in the figure on the left, the cardioid was modified to have a constant value zone from time step $50$ to $150$. The DTW correctly matches the values as can be seen as a straight blue line in the Accumulated Distance plot (right).

Above is presented an example where a cardioid is compared to a circle. The cardioid also had a time delay inserted (values were kept constant). The DTW calculates the distance (here the Euclidean one) between all the points of the two time series and, then, generates another matrix with the accumulated distances. The total distance defined by the path formed with the minimum values of the accumulated distance (right-hand side of the figure) can be easily applied to compare different shapes.

This version of the algorithm uses a C kernel, supporting multidimensional arrays and Euclidean distance, to speed up the calculations with a Python wrapper as the user interface. More details and sample code can be found in this Jupyter notebook:

if you are not happy with my explanations above, one of the best explanations about how the DTW works I've found on a presentation by Elena Tsiporkova.

How to install:

  1. Clone the repository, or download it as a zip file and unzip it.
  2. Inside the directory dtw_python execute make.
  3. Now, to install the library and make it accessible to all users you need to execute sudo make install.
  4. After that you don't need the dtw_python directory anymore and you can test it using the jupyter notebook.

Related works:

References:

  1. Sakoe, H., and S. Chiba. “Dynamic Programming Algorithm Optimization for Spoken Word Recognition.” IEEE Transactions on Acoustics, Speech and Signal Processing 26, no. 1 (February 1978): 43–49.
  2. Meinard Müller. “Dynamic Time Warping.” In Information Retrieval for Music and Motion, ch. 4, 69-82. New York: Springer-Verlag, 2007.
  3. Ratcliff, Roger. “Continuous versus Discrete Information Processing: Modeling Accumulation of Partial Information.” Master Thesis, Radboud University Nijmegen, 2004.

Other projects you may like to check:

  • colab_utils: Some useful (or not so much) Python stuff for Google Colab notebooks
  • ExecThatCell: (Re)Execute a Jupyter (colab) notebook cell programmatically by searching for its label.
  • Maple-Syrup-Pi-Camera: Low power('ish) AIoT smart camera (3D printed) based on the Raspberry Pi Zero W and Google Coral EdgeTPU
  • The CogniFly Project: Open-source autonomous flying robots robust to collisions and smart enough to do something interesting!
  • Bee: The Bee simulator is an open source Spiking Neural Network (SNN) simulator, freely available, specialised in Liquid State Machine (LSM) systems with its core functions fully implemented in C.

http://ricardodeazambuja.com/

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