tslearn icon indicating copy to clipboard operation
tslearn copied to clipboard

DTW (and probably other metrics too) don't raise an error for heterogeneous time series

Open rtavenar opened this issue 5 years ago • 0 comments

Describe the bug When fed with time series of different dimensionalities, DTW (and other methods that are not designed to handle heterogeneous time series (ie time series whose features do not lie in the same ambient space) should raise an error, which is not always the case.

To Reproduce

>>> import numpy as np
>>> from tslearn.metrics import dtw

>>> 
>>> x = np.random.randn(10, 1)
>>> y = np.random.randn(10, 2)
>>> dtw(x, y)
4.794730857157181
>>> dtw(y, x)
inf

Expected behavior Raise an error as soon as dimensionalities (number of features) do not match.

Thanks @lchapel for the notice ;)

rtavenar avatar Jun 29 '20 13:06 rtavenar