# How to calculate f1 score for anomaly detection with one class (Anomaly or No Anomaly)? What is seen as the true positive?

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?

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