Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help #9

Closed
Okroshiashvili opened this issue Feb 16, 2021 · 3 comments
Closed

Need help #9

Okroshiashvili opened this issue Feb 16, 2021 · 3 comments

Comments

@Okroshiashvili
Copy link

  • Python port of R's Comprehensive Dynamic Time Warp algorithm package version: 1.1.6
  • Python version: 3.7
  • Operating System: Ubuntu 18.04

Description

I want to find DTW score between two time series. To understand how these algorithm work I use two libraries, dtw-python and tslearn.

However, I'm getting different results and I don't know why. Any help would be appreciate :)

What I Did

import numpy as np
import tslearn.metrics as tsm
import dtw

x = np.linspace(0, 50, 100)

ts1 = pd.Series(3 * np.sin(x / .5))
ts2 = pd.Series(2 * np.sin(x))

Results


tsm.dtw(ts1, ts2) -> 16.578554103357583

dtw_result = dtw.dtw(x=ts1, y=ts2, dist_method="euclidean", step_pattern="symmetric2") -> 174.2896

Why do I have such a big difference? I tried all the available step_pattern functions for dtw-python library but without any success. Which one is correct result?

@tonigi
Copy link
Collaborator

tonigi commented Feb 16, 2021 via email

@tonigi tonigi closed this as completed Feb 16, 2021
@Okroshiashvili
Copy link
Author

Sorry @tonigi I did not understand what you mean. Can you elaborate little bit more?

@tonigi
Copy link
Collaborator

tonigi commented Feb 16, 2021

. The algorithm can be "run" with pen and paper on small cases. I was suggesting to check which implementation is correct (maybe both, with different conventions) using a "manual" solution as a reference.

I can't debug other people's implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants