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

Using with x/y sizes of (n, m) where m >1 #44

Open
danomics-cam opened this issue Apr 23, 2020 · 3 comments
Open

Using with x/y sizes of (n, m) where m >1 #44

danomics-cam opened this issue Apr 23, 2020 · 3 comments

Comments

@danomics-cam
Copy link

I appreciate your package - it has made my life much easier. However, I have a question that I was hoping you could resolve:
In the case of:
X being an array of size (n,1), and
Y being an array of size (m,1), where m/n are number of samples,

What if I had arrays of:
X being size (n,2), and
Y being size (n,2).

Example of use case being if I have two related time series measurements such as machine vibration frequency and machine operating temperature. Both are distinct measurements, and when doing a manual correlation you can better match events when using both indicators in tandem than just one.

The code certainly runs in both scenarios, and outputs unique paths when I run just component 1 vs. just component 2 vs. both 1 and 2 at same time.

However, with existing documentation it's hard to understand the workings of what is going on.

@danomics-cam danomics-cam changed the title Using with multiple threads Using with x/y sizes of (n, x) where x >1 Apr 23, 2020
@danomics-cam danomics-cam changed the title Using with x/y sizes of (n, x) where x >1 Using with x/y sizes of (n, m) where m >1 Apr 23, 2020
@slaypni
Copy link
Owner

slaypni commented Apr 24, 2020

The function passed as dist parameter is used to calculate distances between each sample of X and Y. Therefore, as long as the dist function can compute distances between two samples, it is not a problem that each sample has multiple dimensions.

@udithhaputhanthri
Copy link

udithhaputhanthri commented Dec 23, 2020

@slaypni Hi, thanks for the great package.

I have a couple of points to clarify.
In the original paper, DTW is measured between just 2 two-time series. But in the example given in the documentation, (5,2) and (3,2) shape data (x,y) are used to get the DTW distance.

  1. What are those dimensions in the data
  2. First I thought that the 1st dimension is the number of samples/ data points and the 2nd dimension is the sequence length. But then the DTW measurement does not make sense to me. Because the number of samples in x and y are different.

Can you please explain how can we use the metric. I could not find the documentation for this in the repository.

(original paper mentioned in the repo: https://www.semanticscholar.org/paper/FastDTW%3A-Toward-Accurate-Dynamic-Time-Warping-in-Salvador-Chan/05a20cde15e172fc82f32774dd0cf4fe5827cad2)

Thanks.

@slaypni
Copy link
Owner

slaypni commented Dec 24, 2020

Please take a look at the test code. There are 1d and 2d examples.
https://github.com/slaypni/fastdtw/blob/master/tests/test_fastdtw.py

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

No branches or pull requests

3 participants