Skip to content

Seanny123/pydtw

master
Switch branches/tags
Code
This branch is 4 commits ahead of jihuni:master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

pydtw

pydtw is a simple python wrapper of libdtw, which is a fast, dynamic time warping library based on the UCR Suite.

Works for Python 3, but not for Windows, because I don't understand the Windows C compiler.

Install

pip install -e .

Usage

import numpy as np
import dtw


data = np.cumsum(np.random.uniform(-0.5, 0.5, 1000000))
query = np.cumsum(np.random.uniform(-0.5, 0.5, 100))
results = dtw.query(data, query, r=0.05)
  • input
    • data : numpy.array of data
    • query : numpy.array of the pattern to be matched
    • r : size of warping window
  • result : dict
    • results["index"] : the index of the first element in the best matching sequence in the data.
    • results["value"] : the DTW distance between the query and the matching sequence in the data.

Known Issues

  • The first element of the time-series is removed when translating from Python to C. I dont't know enough about Python -> C to fix this and it doesn't really matter for my purposes.

About

Fast dynamic time warping library based on the UCR Suite http://www.cs.ucr.edu/~eamonn/UCRsuite.html

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.1%
  • Python 4.2%
  • Makefile 0.7%