A model with 85% accuracy
tp = 50fp = 10fn = 5tn = 35
Result: Accuracy 0.85 · Precision 0.8333 · Recall 0.9091 · F1 0.8696
The confusion matrix is the foundation of classification evaluation: it cross-tabulates predicted vs actual labels. Enter your four counts (true positives, false positives, false negatives, true negatives) and this tool derives accuracy, precision, recall/sensitivity, specificity, F1, balanced accuracy, prevalence, error rate, negative predictive value, and both error rates.
Enter your values and press Calculate — the result appears here.
tp = 50fp = 10fn = 5tn = 35Result: Accuracy 0.85 · Precision 0.8333 · Recall 0.9091 · F1 0.8696
tp = 40fp = 0fn = 0tn = 60Result: Accuracy 1.0 · all error rates 0
tp = 0fp = 20fn = 0tn = 80Result: Accuracy 0.8 · Recall and F1 undefined — no actual positives to find
A 2×2 table comparing predictions to reality: TP (predicted positive, actually positive), FP (predicted positive, actually negative — a false alarm), FN (predicted negative, actually positive — a miss), TN (predicted negative, actually negative). Every classification metric derives from these four counts.
Precision needs at least one positive prediction (TP + FP > 0); recall/sensitivity needs at least one actual positive (TP + FN > 0); specificity needs at least one actual negative (TN + FP > 0). When a denominator is zero, that metric has no meaningful value and is labeled as undefined.
With imbalanced classes, a model that always predicts the majority class can look accurate. On a data set that is 90% negative, always predicting negative gives 90% accuracy but zero recall. Precision, recall, and F1 reveal that failure.
Key Takeaway --> Accuracy is misleading for imbalanced datasets. A model that predicts "no fraud" …
AI & Machine LearningEvaluating an AI system requires more than checking if the answer "looks right." You need 8 dimensi…
CybersecurityAI engineering in 2026 is a distinct discipline requiring Python, machine learning, deep learning, …
CybersecurityKey Takeaway Prompt Engineering is the skill of communicating effectively with AI models. It is not…
AI & Machine LearningKey Takeaway --> Imbalanced datasets cause models to ignore the minority class. Fix this with over…
AI & Machine LearningThe best data science portfolio isn't 20 notebooks that all do the same thing. It's 20 projects tha…
Calculate classification accuracy from true/false positives and negatives.
Try it now →Compute precision — the share of positive predictions that were actually correct.
Try it now →Compute recall (sensitivity) — the share of actual positives the model managed to find.
Try it now →Compute the F1 score — the harmonic mean of precision and recall — from TP, FP, FN, TN.
Try it now →Join the conversation about Machine Learning, confusion matrix, tp fp fn tn on the BestWordz Community forum.
Visit Forum →Have questions about Confusion Matrix Calculator? Join the BestWordz Community.