Output of the distance matrix
arturoribes opened this issue · comments
Arturo Ribes commented
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).
glfeng commented
try:
import scipy.spatial.distance as ssd
dist = ssd.pdist(df, lambda x1, x2: fastdtw.fastdtw(x1, x2,dist=euclidean))
ssd.squareform(dist)
rachitagrwl commented
Can we implement Manhattan distance and call it without using scipy library.?
Arturo Ribes commented
@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.
Arturo Ribes commented
@rachitagrwl of course, you can provide your distance as a two-parameter function