Calculate Similarity multi dimensions array Using fastdtw

Viewed 133

I have trying to use fastdtw to calculate similarity

Here is the working example: The similarity is 0.916%.

dataSetI = [1, 0.5, 2, 2]
dataSetII = [1, 1, 1, 0.51, 2, 1]

x = np.array(dataSetI)
y = np.array(dataSetII)

distance, path = fastdtw(x, y, dist=euclidean)
print("{:.3f}%".format(similarity))#0.916%

But the dataset I am going to compare is a multidimensional array, random index length Example:


dataSetI = [[1, 0.5], [2, 2],[]]]
dataSetII = [[1, 1,3,5], [1, 0.51], [2, 1,5,6,7]]

x = np.array(dataSetI)
y = np.array(dataSetII)

distance, path = fastdtw(x, y, dist=euclidean)
#error here
ValueError: setting an array element with a sequence.

So my question is: Am I able to do this using fastdtw? Or is there any library able to do this? Please let me know. Thx.

1 Answers

Nooo! Dont use FastDTW

FastDTW is approximate and Generally Slower than the Algorithm it Approximates Renjie Wu, Eamonn J. Keogh: ICDE 2021: 2327-2328

Related