Skip to content

Finding multiple motifs with mStump #494

Answered by SaVoAMP
SaVoAMP asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

Now I am able to find the 10 nearest neighbors for each motif! Thank you very much!
Here is my code:

S = stumpy.subspace(dimensions, m, motif_idx, nearest_neighbor_idx, k)
print(f"For k = {k}, the {k + 1}-dimensional subspace includes subsequences from {dimensions.columns[S].values}")

subspace = [dimensions.columns.values[s] for s in S]

query = dimensions[subspace].copy()
T, M_T, Σ_T = core.preprocess(query, m)

excl_zone = int(
        np.ceil(m / config.STUMPY_EXCL_ZONE_DENOM)
    )

# Compute multi-dimensional distance profile
D = _get_multi_distance_profile(
    motif_idx, T, T, m, excl_zone, M_T, Σ_T, M_T, Σ_T
)

matches = []  # stores the distance and idx of the max_matches …

Replies: 2 comments 62 replies

Comment options

You must be logged in to vote
10 replies
@SaVoAMP
Comment options

@seanlaw
Comment options

@SaVoAMP
Comment options

@seanlaw
Comment options

@SaVoAMP
Comment options

Comment options

You must be logged in to vote
52 replies
@seanlaw
Comment options

@seanlaw
Comment options

@SaVoAMP
Comment options

@seanlaw
Comment options

@SaVoAMP
Comment options

Answer selected by SaVoAMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants