Start from the Confusion Matrix
Four counts generate many metrics
For a binary classifier, true positives (TP) and true negatives (TN) are correct predictions; false positives (FP) are false alarms; false negatives (FN) are misses. Accuracy is (TP+TN)/all, precision is TP/(TP+FP), recall is TP/(TP+FN), and specificity is TN/(TN+FP).
1,000 events; 20 real incidents
model predicts every event safe
accuracy = 980/1000 = 98%
recall = 0/20 = 0%
The F1 score is the harmonic mean of precision and recall. It is useful when both matter, but it ignores true negatives and treats precision and recall symmetrically. The F-beta score weights recall more when beta exceeds 1 and precision more when beta is below 1.
Scenario: For a malware blocker, a false positive may stop legitimate business while a false negative permits compromise. Report both counts and let risk owners choose the operating balance.
Goal: The existing ml-model-evaluation and ml-drift-confusion labs make you select metrics and read actual error counts rather than trusting accuracy.