-
Hi, since to distance score is calculated only according to the nearest neighbor, if there is just one nearest neighbor , or 1000, will the score be the same? assuming i have 2 anomalies in a timeseries which are the same, is it reasonable to expect their score will be similar to patterns that occur thousands of times? thanks |
Beta Was this translation helpful? Give feedback.
Answered by
seanlaw
Nov 15, 2023
Replies: 1 comment 4 replies
-
@feigin Welcome to the STUMPY community and thank you for your question. I'm not able to understand your question. Are you able to provide some code to better describe what you are trying to do? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@feigin Indeed, this is the expected behavior. Since each dataset/problem is different, it is up to you to decide how to interpret the results. In this case, you can leverage our recently added
top-k
feature and do:Here, setting
k=3
will return the distance to the top-3 nearest neighbors for each subsequence. Then, we compute the average distance (or sum the distances). In this case, if the anomaly is only repeated once (i.e., there is a single pair), then the average distance will NOT be zero and will therefore stand out as an anomaly. However, it is up to you to decide whatk
shou…