How do we calculate the f1 score in anomaly detection (using a One-Class-Support Vector Machine(OC-SVM))? I am not sure what is considered as a true positive? Is it if I predict an anomaly and the label is "anomaly" or is it the other case: I predict "no anomaly" and the label is "no-anomaly"?

Assuming we got the following scores:

TP:  68
FP:  1184
TN:  1723
FN:  414

We can calculate the F1 score as follows:

F1 with TP=TP:  0.07843
F1 with TN=TN:  0.68318

Depending on which case I see as the "True Positive", I have two different scores! What is typically reported in scientific papers?

  • $\begingroup$ I don't get your point by that these oblivious options TP=TP & TN=TN you mentioned !! but F1=0.07843 $\endgroup$ – Mario Mar 25 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.