Questions tagged [dtw]

dtw means Dynamic Time Warping-type algorithms, which measure the similarity between time series with varying speeds.

124 questions
11
votes
4 answers

Time series distance metric

In order to clusterize a set of time series I'm looking for a smart distance metric. I've tried some well known metric but no one fits to my case. ex: Let's assume that my cluster algorithm extracts this three centroids [s1, s2, s3]: I want to put…
paolof89
  • 1,319
  • 5
  • 17
  • 31
7
votes
2 answers

Different results and performances with different libraries

I'm comparing the libraries dtaidistance, fastdtw and cdtw for DTW computations. This is my code: from fastdtw import fastdtw from cdtw import pydtw import fastdtw import array from timeit import default_timer as timer from dtaidistance import dtw,…
Hagbard
  • 3,430
  • 5
  • 28
  • 64
6
votes
1 answer

Clustering similar time series?

I have somewhere between 10-20k different time-series (24 dimensional data -- a column for each hour of the day) and I'm interested in clustering time series that exhibit roughly the same patterns of activity. I had originally started to implement…
user3083674
5
votes
2 answers

install dtaidistance -> Exception: The compiled dtaidistance C library is not available

I try to run dtaidistance but when running the following code according example : from dtaidistance import dtw import numpy as np timeseries = np.array([ [0., 0, 1, 2, 1, 0, 1, 0, 0], [0., 1, 2, 0, 0, 0, 0, 0, 0], [1., 2, 0, 0, 0, 0,…
Adler Müller
  • 248
  • 1
  • 14
5
votes
0 answers

How do you align multiple time series (not just 2) in python using DTW - Dynamic Time Warping?

I found these two articles discussing aligning multiple 'n' number of time series using dynamic time warping or DTW. How to apply/implement Dynamic Time Warping (DTW) or Fast Dynamic Time Warping (FastDTW) in python between 3 or more…
narnia649
  • 381
  • 2
  • 10
5
votes
1 answer

Dynamic Time Warping implementation in Tensorflow

I've rewritten a Dynamic Time Warping implementation from normal python into Tensorflow. But it's really slow -- much slower than pre-computing distances and loading them into Tensorflow as data. I can't figure out why it's slow or how to improve…
Alex H
  • 76
  • 5
5
votes
2 answers

Comparing MFCC feature vectors with DTW

I'm looking for some advice on Dynamic Time Warping (DTW). I have a Python script and extract Mel-Frequency Cepstral Coefficient (MFCC) feature vectors from .WAV files of various lengths. The feature vectors are arrays of varying lengths that…
amitchone
  • 1,630
  • 3
  • 21
  • 45
4
votes
2 answers

How to get distance matrix using dynamic time warping?

I have 6 time series values as follows. import numpy as np series = np.array([ [0., 0, 1, 2, 1, 0, 1, 0, 0], [0., 1, 2, 0, 0, 0, 0, 0, 0], [1., 2, 0, 0, 0, 0, 0, 1, 1], [0., 0, 1, 2, 1, 0, 1, 0, 0], [0., 1, 2, 0, 0, 0, 0, 0,…
EmJ
  • 4,398
  • 9
  • 44
  • 105
4
votes
1 answer

Parallel for loop over numpy matrix

I am looking at the joblib examples but I can't figure out how to do a parallel for loop over a matrix. I am computing a pairwise distance metric between the rows of a matrix. So I was doing: N, _ = data.shape upper_triangle = [(i, j) for i in…
ITA
  • 3,200
  • 3
  • 18
  • 32
4
votes
2 answers

How to apply dtw algorithm on multiple time series in R?

Problem I have time series of speed of different vehicles. My ultimate objective is to cluster different vehicles based on their similarities in speed over time. So, I basically need to produce a distance matrix where each cell contains the distance…
umair durrani
  • 5,597
  • 8
  • 45
  • 85
3
votes
1 answer

Assessing synchrony between time series

I would like to assess the synchrony between two time series (i.e. do they have the same evolution over time?). I am using Python. Here are examples of the time series that I have: The first plot shows time series that have quite similar evolution…
Falco
  • 183
  • 2
  • 16
3
votes
1 answer

View Optimal dtw Alignment in R

I am using the dtw package in R to align time series data. I can easily obtain the alignment but cannot figure out how to display the optimal alingment with the peaks from both time series match (the stretched/compressed alignment). Plotting the…
Jamie
  • 555
  • 3
  • 14
3
votes
2 answers

Multivariate Dynamic Time Warping(DTW) with R

I'm currently dealing with multivariate dynamic time warping (DTW) in R. The best library I found so far is the dtw package as described here: http://dtw.r-forge.r-project.org/ But I do not know how multivariate dtw is actually implemented and it is…
gprinz
  • 95
  • 1
  • 9
3
votes
0 answers

SVM with Dynamic Time Warping kernel

I need to use Support Vector Machine (SVM) classifier with a Dynamic Time Warping (DTW) kernel for some audio processing task. All the tools I know (Weka, LibSVM, SKLearn) have SVMs with standard kernels (linear, poly, RBF) only. Where can I find a…
m.ahmed
  • 33
  • 3
3
votes
0 answers

DTW package in R Rfor sequence of different length

I have a multiple sequences of different lengths in a list in R. I would like to construct the DTW distance matrix to be used by hierarchical clustering. When I run the following command in R: a2<-dtw(Data[[1]][1],Data[[1]][2]) Error in…
stack
  • 93
  • 8
1
2 3
8 9