Work out precision and recall instantly with clear inputs, formula shown and shareable results.
Precision answers how many flagged items were genuinely positive (TP / (TP + FP)), while recall answers how many genuine positives were caught (TP / (TP + FN)). They trade off against each other as the decision threshold moves, and F1 is their harmonic mean, which punishes a model that wins on one metric by sacrificing the other. Specificity completes the picture from the negative class.
Confusion-matrix metrics
precision = TP / (TP + FP); recall = TP / (TP + FN); F1 = 2PR / (P + R); specificity = TN / (TN + FP)
It depends on the cost of each error. Screening for a serious disease favours recall because a missed case is expensive; blocking content or sending sales outreach favours precision because false alarms annoy real users.
The harmonic mean is dominated by the smaller value, so F1 only rises when precision and recall are both reasonable. An arithmetic mean would reward a model with 100 percent precision and 2 percent recall.