How this instrument works
A confusion matrix is the standard way to lay out how a binary classifier's predictions compare to reality: true positives (TP, correctly flagged as positive), false positives (FP, wrongly flagged as positive), false negatives (FN, wrongly flagged as negative), and true negatives (TN, correctly flagged as negative). Every prediction the classifier ever makes falls into exactly one of these four cells, and from just those four counts, every standard classification metric can be derived.
Accuracy is the simplest of them — the overall fraction of predictions that were correct — but it can be misleading on imbalanced data, where one class vastly outnumbers the other. Precision asks, of everything flagged positive, how much actually was; recall (also called sensitivity) asks, of everything that actually was positive, how much got flagged; specificity asks the mirror question for the negative class. F1 combines precision and recall into a single number using their harmonic mean, which penalizes a large imbalance between the two more heavily than a simple average would.
This instrument takes raw TP/FP/FN/TN counts and derives all five rates from them — the reverse direction from a related calculator, false-positive, which instead starts from an already-known false-positive rate and a count of negative cases to predict how many false positives to expect going forward. Confusion-matrix looks backward at results you already have; false-positive looks forward from a known rate to a predicted count. Both are also distinct from a Bayesian false-positive-paradox question (what's the chance a positive result is actually wrong, given a rare condition and an imperfect test) — that's a different calculation from any of the plain rate arithmetic here.
- Enter the number of correctly flagged positives into True positives, and wrongly flagged positives into False positives.
- Enter the number of missed actual positives into False negatives, and correctly flagged negatives into True negatives.
- Read Accuracy for the overall fraction of predictions that were correct across all four cells.
- Read Precision (positive predictive value) and Recall (sensitivity) for how trustworthy positive flags are, and how many real positives got caught.
- Read Specificity for the negative-class mirror of recall, and F1 score for the single number balancing precision and recall together.
Worked example — a spam filter's results on 165 emails
A spam filter is tested against 165 emails: it correctly flags 50 spam emails as spam (TP=50), wrongly flags 10 legitimate emails as spam (FP=10), misses 5 actual spam emails and lets them through (FN=5), and correctly lets 100 legitimate emails through (TN=100). Entering those four counts, Accuracy reads 0.909091, computed as (50+100)/165 — about 91% of all 165 emails were classified correctly overall.
Precision (positive predictive value) reads 0.833333 (50/60): of every email the filter flagged as spam, five out of six actually were. Recall (sensitivity) reads 0.909091 (50/55): of every actual spam email, about 91% got caught. F1 score reads 0.869565, the harmonic mean balancing those two, and Specificity reads 0.909091 (100/110): of every actual legitimate email, about 91% correctly made it through untouched.
Questions
How is this different from the site's false-positive calculator?
This page runs in the opposite direction. Confusion-matrix starts from raw TP/FP/FN/TN counts you already have (say, from testing a classifier) and derives rates like precision and recall from them — a backward-looking summary of results already observed. This site's separate false-positive calculator instead starts from an already-known false-positive rate and a count of negative cases, and predicts forward how many false positives to expect — a forecasting question, not a summarizing one. They use related numbers but answer opposite directions of the same underlying question.
Why does accuracy sometimes look good even when the classifier is bad?
Accuracy treats every correct prediction equally, which becomes misleading when one class is much rarer than the other. A classifier that always predicts 'negative' on a data set that's 99% genuinely negative gets 99% accuracy while catching zero of the positives that actually matter — precision, recall, and F1 expose that failure clearly, since recall on the positive class would read exactly 0, while accuracy alone would look nearly perfect.
When should I care about precision more than recall, or the reverse?
It depends on which kind of mistake is costlier for the specific problem. High-recall priorities suit situations where missing a real positive is expensive or dangerous (medical screening, fraud detection), even at the cost of more false alarms; high-precision priorities suit situations where a false alarm is expensive or disruptive (spam filtering that shouldn't block real mail) even if it means missing some positives. F1 is a reasonable single number when both kinds of mistake matter roughly equally.
What does an F1 score of 0 mean, and can it happen even with a nonzero accuracy?
F1 is 0 whenever precision or recall is 0 — meaning either every positive flag was wrong, or every actual positive was missed entirely. This can absolutely happen alongside a high accuracy figure, especially on imbalanced data: a classifier that never flags anything positive can still score high accuracy on a mostly-negative data set while its F1 score sits at exactly 0, since recall is 0 in that case.
Why do I need all four counts — couldn't accuracy alone summarize the classifier?
Because accuracy alone collapses four genuinely different kinds of outcome into one number, hiding exactly the information that precision, recall, specificity, and F1 are designed to surface. Two classifiers can share identical accuracy while having wildly different false-positive and false-negative counts underneath — this instrument needs all four cells specifically so it can pull those separate stories back apart.