Evaluating a Classifier Using a Confusion Matrix
Problem Setup
Scenario:Evaluate a binary classifier using the outcomes recorded in its confusion matrix.
Given:A confusion matrix containing 40 true positives, 10 false negatives, 15 false positives, and 135 true negatives.
Task:Use the confusion matrix counts to calculate Accuracy, Precision, Recall (Sensitivity), and F1 Score, then interpret the resulting performance measures.
Need a quick refresher? Review Confusion Matrix theory
Confusion Matrix
The matrix compares actual and predicted classes, showing the correct predictions and the two types of classification errors.Positive Class = Fraudulent | Negative Class = Legitimate
Calculation Breakdown
Accuracy
What proportion of all predictions were correct?
Precision
When the AI predicted 'Yes', how often was it actually right?
Recall (Sensitivity)
Out of all the actual 'Yes' cases, how many did the AI successfully find?
F1 Score
The harmonic mean. It forces a balance between Precision and Recall.
Final Answer
Accuracy:87.5 %
Precision:72.727 %
Recall:80 %
F1 Score:76.19 %
The classifier misses 10 of the 50 fraudulent transactions and incorrectly flags 15 legitimate transactions. Its 87.5% accuracy shows strong overall correctness, but Precision and Recall reveal the mistakes affecting fraud detection that Accuracy alone does not explain.
Exam Takeaway
- Check class balance before interpreting Accuracy: Accuracy measures overall correctness, but it can look high when one class dominates. A majority-class prediction strategy is a useful baseline for judging whether the result is meaningful.
- Do not confuse Precision with Recall: Precision uses all predicted positives as its denominator, while Recall uses all actual positives . Identify which group the question refers to before choosing the formula.
- Use F1 Score to assess the balance between Precision and Recall: The harmonic mean is pulled down when either metric is low. F1 is useful when both types of positive-class errors matter, but it does not account for true negatives.