-
Notifications
You must be signed in to change notification settings - Fork 107
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
Stomp calculates wrong MP vectors for two time series comparison #40
Comments
Not sure what your first assertion is checking for (it seems to only check the first element in mp_a_b) - mp_a_b is not actually 0-filled (you can test it with mp_a_b.any()) But I'm seeing the same issue with comparing STOMP(A) != STOMP(A,A) As far as I can tell, the issue is within STOMPDistanceProfile (I haven't tried to check this with STAMP) in the selfJoin check: |
Put in a simple fix for STOMP(A) != STOMP(A,A). |
@Ofer-Idan any update on the above? |
Never compare floating point numbers for exact equality. |
@vanbenschoten the PR for STOMP(A) != STOMP(A,A) was merged, so @MichaelDoron's original issue should be resolved (and this issue closed). (I haven't had a chance to look into my other STOMP issues in a while as I moved to a different project, but that should be a separate issue altogether) Thanks! |
Hey, thanks for looking into this. |
matrixprofile-ts/matrixprofile/utils.py Line 154 in bcba7dc
|
Reproduction:
from matrixprofile import *
a = np.random.rand(500)
b = np.random.rand(500)
mp_a_1 = matrixProfile.stomp(a,10,a)[0]
mp_a_2 = matrixProfile.stomp(a,10)[0]
mp_a_b = matrixProfile.stomp(a,10,b)[0]
assert np.max(np.abs(mp_a_b[0])) > 0, 'stomp returns 0-filled vectors when tsB != tsA'
assert (mp_a_1[0] == mp_a_2[0]).all(), 'stomp returns different vectors when tsB = tsA and when tsB = None'
The text was updated successfully, but these errors were encountered: