-
Notifications
You must be signed in to change notification settings - Fork 336
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
Is it possible to limit the range of similarity computation? (Dynamic Time Warping) [K-Shape] #370
Comments
That is most definitely possible. Please check our user guide: https://tslearn.readthedocs.io/en/stable/user_guide/dtw.html The things you are looking for are called constraints. We support two types: |
Ah, thanks a bunch @GillesVandewiele! I did not realize this was still k-shapes related. I will read into it! |
Most welcome. I am not sure about how to use it for K-shape myself at the moment. It might require some patching. In case you manage to make it work, please comment here on how you did it! |
Will do! I will do some fiddling with K-shapes in some ways. The biggest issue with K-shape for me is, that it requires a dataset of equal-sized time series. For my use-case I am clustering time series of energy consumption and sometimes I do not have them for the whole year but only for a few months. |
Not immediately from the top of my head... You could cut the longer timeseries into smaller windows as a preprocessing step or pad the shorter ones with noise perhaps? These are rather rudimentary and probably not the ideal solution though. |
Yes, those are possible workarounds if everything else fails, I am actually on it right now 👍 |
Did not really succeed on that, as I realized that K-Shape does not use DTW but SBD. Now the questions is, how can that be adjusted? I was checking the functions for SBD usage, I guess this is where it is used / created. I tried to backtrack Is there a way to find out more about it? When i wanted to go to the definition I just got this: What does it exactly do?
|
I would like to have DTW only move within a certain range, so that a point will not be matched to another point that is more than x steps away.
I hope this visualization helps:
https://i.imgur.com/hlw9iOF.png
Thanks in advance
Picture edited from Paparrizos and Gravano, "k-Shape: Efficient and Accurate Clustering of Time Series" (2016)
!
The text was updated successfully, but these errors were encountered: