Finding Top K Neighbours #1034
Replies: 4 comments 4 replies
-
In addition, as I understood stumpy.motifs code sorts the top-k neighbors of the first best motif pairs' minima. But as you can see, it ignores some values, why? |
Beta Was this translation helpful? Give feedback.
-
Hi @aycabayraktar Thank you for your question and welcome to the stumpy community!
For the right/left index, you'll have to re-compute the distances based on the subsequence index. So, let's say your motif was located at
What do you mean by "ignores some values"? What values do you feel have been ignored? I recommend reading through the stumpy.motifs docstring to get a better idea of what is calculated and what results are stripped/filtered away |
Beta Was this translation helpful? Give feedback.
-
Hi @seanlaw , thank you for your answer. Let me explain:
|
Beta Was this translation helpful? Give feedback.
-
@seanlaw thank you. I am sharing the code snippet. import yfinance as yf
# Define tickers for NASDAQ and get data
nasdaq_data = yf.Ticker("^IXIC").history(period="5y", interval="1d")
# matrix profile for 20 days window length
mp = stumpy.stump(nasdaq_data['Close'], m=20)
#top K motifs of the best
stumpy.motifs(nasdaq_data['Close'], mp[:, 0],max_distance=2.0)
#index = 151 values which are the motifs best pairing with motif_idx
condition = mp[:, 1] == 151
indexes = np.where(condition)[0]
#value of index 48 which is smaller than some values in the result set of stumpy.motifs
mp[48] |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I need to find the top K neighbour of the best motif pair. Actually, I can use the right or left index but how I am going to decide how far away the right index subsequence is from the original motif
Beta Was this translation helpful? Give feedback.
All reactions