Skip to content

Python CFFI-bindings for Dynamic Time Wrappings with UCR optimizations

License

Notifications You must be signed in to change notification settings

alendit/ucrdtw_cffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UCRDTW-cffi: Dynamic Time Warping with UCR optimizations

Build Status

Based on Searching and Mining Trillions of Time Series Subsequences under Dynamic Time Warping .

C implementation from libdtw.

Interface and tests from https://github.com/klon/ucrdtw/.

Requirements

Python 2.7+ or 3.3+, numpy 1.8+

Usage

from ucrdtw_cffi import dtw_query
import numpy as np
import matplotlib.pyplot as plt

data = np.cumsum(np.random.uniform(-0.5, 0.5, 1000000))
query = np.cumsum(np.random.uniform(-0.5, 0.5, 100))
loc, dist = _ucrdtw.ucrdtw(data, query, 0.05, True)
query = np.concatenate((np.linspace(0.0, 0.0, loc), query)) + (data[loc] - query[0])

plt.figure()
plt.plot(data)
plt.plot(query)
plt.show()

About

Python CFFI-bindings for Dynamic Time Wrappings with UCR optimizations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published