Skip to content

Why do DTW distance metrics behave differently? #5814

Answered by fkiraly
fergus-pick asked this question in Q&A
Discussion options

You must be logged in to vote

Update: I know what is going on, this is not a bug.

dtw_dist is a pairwise distance, so expects - consistently with all other panel data estimators - input in one of the sktime Panel formats, e.g., numpy3D with (n_instance, n_variable, n_timepoints).

So, if you pass dtw_dist(X, X), you will get a matrix where the (0,1)-the and (1,0)-th element are, as expected, 2.256etc.

I am not sure why it runs with 2D numpy, it seems to assume a single instance with 24 variables and 1 time point. For which the DTW distance is the same as the squared distance, if the inner distance (on scalars) is squared euclidean.

That would explain the behaviour?


Old post (incorrect)

Hm, that is curious. DtwDist sho…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@fkiraly
Comment options

@fkiraly
Comment options

@fkiraly
Comment options

@fergus-pick
Comment options

@fkiraly
Comment options

Answer selected by fergus-pick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
module:distances&kernels dists_kernels and distances modules: time series distances, kernels, pairwise transforms
2 participants