- Year not given
Confusion matrix and performance measures
Short answer
A confusion matrix compares actual vs predicted classes. Measures include accuracy, sensitivity (TPR), specificity (TNR), precision, NPV, FPR, FNR, and error rate, calculated from TP, FN, FP, TN.
Describe Confusion Matrix with example. Define Accuracy, Error rate, Sensitivity, Specificity, Precision, Recall, Positive Predictive Value and Negative Predictive Value, TPR, TNR, FPR, FNR of the classifier model.
A confusion matrix (contingency table) summarises the performance of a classifier on test data by comparing actual classes with predicted classes. For two classes (positive = class of interest):
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | TP | FN |
| Negative | FP | TN |
- TP (true positives): positives correctly predicted
- TN (true negatives): negatives correctly predicted
- FP (false positives): negatives wrongly predicted positive
- FN (false negatives): positives wrongly predicted negative
Example (cancer test, 1000 records): TP = 90, FN = 60, FP = 40, TN = 810.
Measures
| Measure | Formula | Example |
|---|---|---|
| Accuracy | (TP + TN)/(TP + TN + FP + FN) | 900/1000 = 0.90 |
| Error rate | (FP + FN)/total = 1 − accuracy | 0.10 |
| Sensitivity = Recall = TPR | TP/(TP + FN) | 90/150 = 0.60 |
| Specificity = TNR | TN/(TN + FP) | 810/850 = 0.953 |
| Precision = PPV | TP/(TP + FP) | 90/130 = 0.692 |
| NPV | TN/(TN + FN) | 810/870 = 0.931 |
| FPR | FP/(FP + TN) = 1 − TNR | 40/850 = 0.047 |
| FNR | FN/(FN + TP) = 1 − TPR | 60/150 = 0.40 |
Meaning: accuracy is the overall fraction correct; sensitivity/recall is how many real positives are found; specificity is how many real negatives are found; precision (positive predictive value) is how many predicted positives are really positive; NPV is how many predicted negatives are really negative. Accuracy alone is misleading on imbalanced classes, so sensitivity, specificity and precision are also reported.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Measures from confusion matrix (152, 130) · Data Mining, chapter 3
- Measures from cancer confusion matrix · Data Mining, chapter 3
- Inverse relation of precision and recall · Data Mining, chapter 3
- Accuracy, precision, sensitivity, resolution · Instrumentation and Measurement, chapter 3