Confusion Matrix Calculator

Find accuracy, precision, recall and F1 from a confusion matrix.

Precision 0.8889
Recall 0.8
F1 score 0.8421
Accuracy 0.85

Formula: precision = TP/(TP+FP); recall = TP/(TP+FN)

Step-by-step with your numbers:
1. Values used:
2. True positives = 80
3. False positives = 10
4. False negatives = 20
5. True negatives = 90
6.
7. Precision = 0.8889
8. Recall = 0.8
9. F1 score = 0.8421
10. Accuracy = 0.85
Did we solve your problem today?

The confusion matrix summarizes a classifier's correct and incorrect predictions.

How the Math Works

A confusion matrix organizes prediction outcomes into four categories: True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN). Precision measures the accuracy of positive predictions by dividing TP by all positive predictions (TP + FP), while recall measures how well the model finds actual positives by dividing TP by all actual positives (TP + FN). These ratios reveal whether your model is overly cautious (high precision, low recall) or overly aggressive (high recall, low precision) in its predictions.

Practical Applications

To use this calculator, input your model's predictions against actual outcomes from a test dataset. Enter the counts for each confusion matrix cell - for example, if testing a medical diagnosis model, TP might be patients correctly identified as having a disease, FP healthy patients misdiagnosed as sick, and so forth. The calculator then instantly computes accuracy (overall correctness), precision (positive predictive value), recall (sensitivity), and F1 score (harmonic mean balancing precision and recall) to give you comprehensive performance metrics.

Day-to-Day Use

Understanding these metrics helps you make better decisions in everyday scenarios where predictions matter. When evaluating news sources, you can assess precision by checking what percentage of their 'breaking news' alerts are actually significant, and recall by determining if they report on most important stories. In personal finance, these concepts help evaluate credit card fraud detection systems - you want high recall to catch most fraudulent transactions, but also need precision to avoid false alarms that block legitimate purchases.

Worked example

TP 80, FP 10, FN 20 → precision 0.89, recall 0.80, F1 0.84.

FAQ

Precision vs recall?

Precision is how many predicted positives are real; recall is how many real positives you caught.