A spam filter has TP = 80, FP = 40, FN = 20, TN = 860. What is its precision (0 to 1)?
Answer: 0.667
Precision = TP / (TP + FP) = 80 / 120 ≈ 0.667: of everything flagged as spam, two thirds really was spam.