Inconsistent behavior of stumpy.motifs across Stumpy versions #794
-
I am trying to recreate the example from this discussion, which uses stumpy.motifs() to detect the top 2 motifs from a univariate sensor time series dataset. When I run the code using Stumpy 1.11, I do not get the same result. Specifically, the indices and distances returned by the call are of size (1, x) in Stumpy 1.11 and size (3, x) in Stumpy 1.9.1 (x depends on max_matches). What am I doing wrong here? Or is the behavior indeed inconsistent? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@amurthy-sunysb I think the issue is that when
By increasing
I hope that helps |
Beta Was this translation helpful? Give feedback.
-
Thank you @seanlaw! Did the default behavior of |
Beta Was this translation helpful? Give feedback.
@amurthy-sunysb I think the issue is that when
cutoff=None
, STUMPY tries its best to guess at the "best" rational cutoff value according tonp.nanmax([np.nanmean(P) - 2.0 * np.nanstd(P), np.nanmin(P)])
. However, in this case,np.nanmean(P) - 2.0 * np.nanstd(P)
is negative and so the smallest possible cutoff is set tonp.nanmin(P)
. Unfortunately, all of the matches have a distance that is greater thanmax_distance
(also a guess by STUMPY). So, ultimately, you need to do something like:By increasing
cutoff
to an even larger value will give you more motifs while decreasingmax_distance
will reduce the number of possible matches. T…