ruiking04 / COCA

Deep Contrastive One-Class Time Series Anomaly Detection
30 stars 9 forks source link

F1-Score #31

Open marciahon29 opened 1 month ago

marciahon29 commented 1 month ago

Hello,

Please could you let me know how you calculated the F1-Score for UCR?

The reason I am asking is that you determine accuracy based on if an anomaly is found within the range.

How do you calculate:

  1. Precision / Recall?
  2. truePositive/falsePositive/falseNegative?
  3. F1-Score?

Thanks, Marcia

ruiking04 commented 1 week ago

For UCR, we use two indicators, Affiliation F1 and accuracy. Affiliation F1 is the maximum value of the predicted anomaly score we find and set as the threshold. Samples with anomaly scores equal to the threshold are anomalies. Because each sub-dataset of UCR has only one anomaly fragment, this method is faster to calculate.

Then Affiliation F1 is calculated based on the paper [1].

[1] A. Huet, J. M. Navarro, and D. Rossi, Local evaluation of time series anomaly detection algorithms, in ACM SIGKDD, 2022, pp. 635–645.