Evaluation Metrics & The Confusion Matrix Formulas & Cheat Sheet
Complete chapter-wise reference, step-by-step formula explanations, structured table, and board exam trap warnings.
Core Concepts & Theoretical Foundations
- Confusion Matrix: A 2x2 contingency table evaluating classification model predictions against true ground reality:
- - True Positive (TP): Reality = Positive, Model predicted = Positive (Correct).
- - True Negative (TN): Reality = Negative, Model predicted = Negative (Correct).
- - False Positive (FP / Type I Error): Reality = Negative, Model predicted = Positive (False Alarm).
- - False Negative (FN / Type II Error): Reality = Positive, Model predicted = Negative (Dangerous Miss).
- Metrics: Accuracy, Precision, Recall, F1 Score.
- High Cost of FP vs High Cost of FN: In spam detection, FP is costly (important email in spam). In medical cancer diagnosis or forest fire alarms, FN is catastrophic (cancerous patient sent home).
Chapter Formulas & Equations (4 entries)
| # | Topic / Formula Name | Mathematical Form & Equation | Conditions, Meaning & Board Tips |
|---|---|---|---|
| 1 | Accuracy Metric Formula |
|
Overall fraction of correct predictions. Misleading in severely imbalanced datasets. |
| 2 | Precision Metric Formula |
|
Out of all instances the model predicted as positive, how many were actually positive? Focuses on minimizing False Positives. |
| 3 | Recall (Sensitivity) Metric Formula |
|
Out of all actual positive cases in reality, how many did the model capture? Focuses on minimizing False Negatives. |
| 4 | F1 Score (Harmonic Mean) Formula |
|
Harmonic mean of Precision and Recall. Balances both metrics, punishing models with extreme trade-off skew. |
CBSE Board Exam Tips & Frequent Pitfalls
- CBSE ALWAYS asks a 4-mark numerical on Confusion Matrix calculations: memorize the four formulas perfectly.
- When False Positives are costlier than False Negatives, optimize for Precision. When False Negatives are costlier, optimize for Recall.
Step-by-Step Worked Board Exam Examples
Example 1: An AI model for detecting COVID-19 tests 100 patients. Confusion Matrix: TP = 40, FP = 10, FN = 5, TN = 45. Calculate: (i) Accuracy, (ii) Precision, (iii) Recall, (iv) F1 Score.
Step 1: Accuracy = (TP + TN) / Total = (40 + 45) / 100 = 85 / 100 = 85%.
Step 2: Precision = TP / (TP + FP) = 40 / (40 + 10) = 40 / 50 = 0.80 (80%).
Step 3: Recall = TP / (TP + FN) = 40 / (40 + 5) = 40 / 45 = 0.8889 (88.89%).
Step 4: F1 Score = 2 * (0.80 * 0.8889) / (0.80 + 0.8889) = 1.4222 / 1.6889 = 0.8421 (84.21%).
Common Mistakes to Avoid in Exam
- Using arithmetic mean instead of harmonic mean for F1 Score.
- Swapping the denominator of Precision (TP + FP) with Recall (TP + FN).
Target Practice Questions
Q1. In a fire alarm system, which error is far more dangerous: a False Positive or a False Negative? Explain.
Correct Answer: A False Negative is far more dangerous because a real fire would rage undetected without an alarm, risking human lives. A False Positive merely causes a brief nuisance evacuation.
Frequently Asked Questions
Q. Why is Accuracy an insufficient metric for an AI model detecting rare cancer occurring in 1 out of 1000 people?
A naive model that always predicts 'No Cancer' would achieve 99.9% accuracy, yet it would fail to detect the single real cancer patient (Recall = 0%), making accuracy dangerously deceptive.