fastdtw icon indicating copy to clipboard operation
fastdtw copied to clipboard

Output of the distance matrix

Open arturoribes opened this issue 7 years ago • 4 comments

Is it possible to output the distance matrix? Right now it is just the distance and the path (which can also be obtained from the distance matrix).

arturoribes avatar Oct 06 '17 10:10 arturoribes

try:

import scipy.spatial.distance as ssd
dist = ssd.pdist(df, lambda x1, x2: fastdtw.fastdtw(x1, x2,dist=euclidean))
ssd.squareform(dist)

glfeng318 avatar Jun 25 '18 08:06 glfeng318

Can we implement Manhattan distance and call it without using scipy library.?

rachitagrwl avatar Jul 04 '18 09:07 rachitagrwl

@feng5 I don't quite understand your example. What is df? From the docs, it should be an array of m observations in n-dimensional space. In my case, I want the distance matrix that fastdtw uses to obtain the alignment between 2 sequences of different lengths in a d-dimensional space.

arturoribes avatar Jul 25 '18 06:07 arturoribes

@rachitagrwl of course, you can provide your distance as a two-parameter function

arturoribes avatar Jul 25 '18 07:07 arturoribes