Confusion Matrix & Classification Metrics Cheat Sheet
A printable reference covering confusion matrices, accuracy, precision, recall, specificity, F1 score, and classification thresholds for grades 11-12.
Related Worksheets
Related Infographics
This cheat sheet covers how to summarize and evaluate classification models using a confusion matrix. Students need it to understand how predictions can be correct or incorrect in different ways. It is especially useful in statistics, data science, machine learning, and real-world decision problems such as medical testing or spam detection. The core idea is to compare predicted classes with actual classes, then count true positives, false positives, true negatives, and false negatives. From these counts, you can calculate metrics such as accuracy, precision, recall, specificity, and score. These metrics answer different questions, so the best metric depends on the cost of each kind of error.
Key Facts
- A confusion matrix organizes classification results into , , , and by comparing predicted labels with actual labels.
- Accuracy measures the overall fraction of correct predictions and is calculated by .
- Precision measures how many predicted positives were actually positive and is calculated by .
- Recall, also called sensitivity, measures how many actual positives were correctly found and is calculated by .
- Specificity measures how many actual negatives were correctly identified and is calculated by .
- The false positive rate is calculated by , and it equals .
- The false negative rate is calculated by , and it equals .
- The score balances precision and recall using .
Vocabulary
- Confusion matrix
- A table that compares predicted classes with actual classes to show correct and incorrect classification results.
- True positive
- A true positive, written , is a case where the model predicts positive and the actual class is positive.
- False positive
- A false positive, written , is a case where the model predicts positive but the actual class is negative.
- False negative
- A false negative, written , is a case where the model predicts negative but the actual class is positive.
- Precision
- Precision is the proportion of positive predictions that are correct, calculated by .
- Recall
- Recall is the proportion of actual positives that are correctly identified, calculated by .
Common Mistakes to Avoid
- Confusing false positives with false negatives is wrong because they describe opposite error types. A false positive predicts positive when the truth is negative, while a false negative predicts negative when the truth is positive.
- Using accuracy alone with imbalanced data is misleading because a model can look accurate by mostly predicting the majority class. For rare positives, precision, recall, and score often give better information.
- Putting and in the wrong cells changes every metric that uses them. Always check whether rows represent actual labels or predicted labels before calculating.
- Treating precision and recall as the same metric is wrong because precision focuses on positive predictions, while recall focuses on actual positives. A model can have high precision but low recall, or high recall but low precision.
- Raising or lowering the classification threshold without checking error tradeoffs is risky because it usually changes both and . A lower threshold often increases recall but may decrease precision.
Practice Questions
- 1 A classifier has , , , and . Calculate the accuracy.
- 2 A medical test gives , , and . Calculate the precision and recall.
- 3 A model has precision and recall . Calculate the score using .
- 4 For a disease screening test, explain whether false positives or false negatives are usually more dangerous, and justify which metric should be emphasized.