Handling Constant Query Motifs in MASS #602
Replies: 6 comments 1 reply
-
Not a bug. Solution 1: |
Beta Was this translation helpful? Give feedback.
-
@AndiBerber Thank you for your question and welcome to the STUMPY community. I wonder if the issue is that the query subsequence is also constant (in addition to a part of your time series being constant). In that case, this may be an undesirable input since, as @JaKasb pointed out, this would cause a "divide by zero" in the z-normalization of your subsequence. In this instance, what would you expect the output to be? In case it is relevant, you can set
|
Beta Was this translation helpful? Give feedback.
-
Thank you guys @JaKasb and @seanlaw for your friendly and welcoming support. Everything works out as expected when I use
I guess I found what I was looking for with a bunch of if/else savety checks in Best regards, Andi |
Beta Was this translation helpful? Give feedback.
-
@AndiBerber Can you please tell me what version of STUMPY you are using? The latest version is v1.11.1. By default, STUMPY throws an error when the input isn't of type
I get:
This is the same error that I get when I execute your code using the latest version of STUMPY. Regarding constant regions. There are two key scenarios:
Detecting a constant subsequence is quite straightforward as all you need to do is find the subsequences that have a zero stddev. If it does then the subsequence must be constant. So, after you compute mass using a covolution, you can perform some sort of post-processing step. In case #1, you'd just check if your query subsequence is constant (i.e., stddev == 0.0) and then look for all subsequences in your time series that are constant (i.e., stddev == 0.0) and simply set all of those distances in your distance profile (output pf MASS) to zero. Case #1 is the easy/obvious case. However, in case #2, when only the query OR the subsequence in your time series is constant then it isn't exactly clear what the expected result would/should be. In your example, since your query is constant, you experience both case #1 and case #2 but I have no confidence in how to interpret the distances where time series is NOT constant (i.e., random numbers). Currently, in |
Beta Was this translation helpful? Give feedback.
-
@seanlaw : Indeed, my version is Thanks again. |
Beta Was this translation helpful? Give feedback.
-
@AndiBerber If you don't mind, I'd like to move this issue to the Discussion section of our repository |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The distance profile is not calculated reliably for constant motifs. Given the following code, 0, 1 or 2 dips are seen:
Is it only on my machine ?
Beta Was this translation helpful? Give feedback.
All reactions