Skip to content

Handling Constant Query Motifs in MASS #600

Description

@AndiBerber

The distance profile is not calculated reliably for constant motifs. Given the following code, 0, 1 or 2 dips are seen:

import numpy as np 
import stumpy
import matplotlib.pyplot as plt

tgtLength = 5000
tgt = np.zeros(tgtLength, dtype = np.float32)
for index in range(tgtLength):
    if index < 500:
        tgt[index] = np.random.rand(1)[0]
    if index >= 500 and index < 1000:
        tgt[index] = 3
    if index >= 1000:
        tgt[index] = np.random.rand(1)[0]
        
window_size = 500
qry = np.ones(window_size, dtype = np.float32) * 3    
plt.plot(tgt)
plt.plot(qry)
plt.show()
plt.close()

distance_proile = stumpy.mass(qry, tgt)
plt.plot(distance_proile)
plt.show()
plt.close()

Is it only on my machine ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions