CONFUSION MATRIX
Confusion Matrix
Is it a CAT or NOT a CAT?
Click a button above
Learn how the model decides whether something is CAT or NOT A CAT.
๐ฑ๐ถ Confusion Matrix — Cat & Dog
Learn TP, TN, FP and FN by making predictions.
TP
Actual = CAT
Prediction = CAT
TN
Actual = DOG
Prediction = NOT A CAT
FP
Actual = NOT A CAT(DOG)
Prediction = CAT
FN
Actual = CAT
Prediction = NOT A CAT (DOG)
๐งช Test Cases
Look at the actual animal and choose the model's prediction.
๐ Confusion Matrix
| Predicted CAT | Predicted DOG | |
|---|---|---|
| Actual CAT | 0 | 0 |
| Actual DOG | 0 | 0 |
๐ Confusion Matrix Formula Guide
Learn the important classification formulas, their uses, advantages, disadvantages and interpretation.
| Predicted Positive | Predicted Negative | |
|---|---|---|
| Actual Positive | TP True Positive |
FN False Negative |
| Actual Negative | FP False Positive |
TN True Negative |
Accuracy
Measures the overall percentage of correct predictions.
Precision
Measures how many predicted positives are actually positive.
Recall / Sensitivity
Measures how many actual positives were correctly detected.
Specificity
Measures how many actual negatives were correctly identified.
F1 Score
Balances Precision and Recall.
Fฮฒ Score
Allows different importance to Precision and Recall.
False Positive Rate
Measures the percentage of negatives incorrectly classified as positive.
False Negative Rate
Measures the percentage of positives incorrectly classified as negative.
Negative Predictive Value
Measures how reliable a negative prediction is.
Positive Predictive Value
Another name for Precision.
Balanced Accuracy
Useful when classes are imbalanced.
MCC
Measures the quality of binary classification.
Threat Score / CSI
Useful when the positive class is more important.
Diagnostic Odds Ratio
Compares the odds of a positive result in positives versus negatives.
Error Rate
Measures the overall percentage of incorrect predictions.
1️⃣ Accuracy
๐ Use
✅ Advantages
• Considers both positive and negative predictions.
• Useful for balanced datasets.
❌ Disadvantages
• Does not tell us whether errors are FP or FN.
• A high accuracy does not always mean a good model.
๐ก Interpretation
2️⃣ Precision
๐ Use
✅ Advantages
• Useful when False Positives are expensive.
• Important in spam detection and recommendation systems.
❌ Disadvantages
• High Precision can be achieved by predicting positive very rarely.
• Does not measure all actual positive cases.
๐ก Interpretation
3️⃣ Recall / Sensitivity
๐ Use
✅ Advantages
• Very useful when missing a positive case is costly.
• Important in medical screening.
❌ Disadvantages
• Increasing Recall can increase False Positives.
• High Recall alone does not guarantee a good model.
๐ก Interpretation
4️⃣ Specificity
๐ Use
✅ Advantages
• Useful in medical testing and screening.
• Helps control False Positives.
❌ Disadvantages
• High Specificity may occur with poor Recall.
5️⃣ F1 Score
๐ Use
✅ Advantages
• Useful for imbalanced datasets.
• Penalizes models with poor Precision or Recall.
❌ Disadvantages
• May hide whether Precision or Recall is the actual problem.
• Not always suitable when TN is important.
6️⃣ Fฮฒ Score
๐ Use
✅ Advantages
• Allows domain-specific priorities.
• Useful when one type of error is more costly.
❌ Disadvantages
• Requires choosing an appropriate ฮฒ value.
7️⃣ False Positive Rate
๐ Use
✅ Advantage
• Important for ROC curve analysis.
❌ Disadvantage
• Alone it cannot describe overall model performance.
8️⃣ False Negative Rate
๐ Use
✅ Advantages
• Important when False Negatives are dangerous.
❌ Disadvantages
• Does not show False Positive behavior.
9️⃣ Negative Predictive Value
๐ Use
✅ Advantages
• Particularly useful in diagnostic applications.
❌ Disadvantages
• Not sufficient as a standalone metric.
๐ Balanced Accuracy
๐ Use
✅ Advantages
• Gives equal importance to both classes.
❌ Disadvantages
• Can still hide some types of prediction errors.
1️⃣1️⃣ Matthews Correlation Coefficient
๐ Use
✅ Advantages
• Works well with imbalanced datasets.
• Values range from −1 to +1.
❌ Disadvantages
• More difficult for beginners to interpret.
1️⃣2️⃣ Threat Score / Critical Success Index
๐ Use
✅ Advantages
• Penalizes both FP and FN.
❌ Disadvantages
• Not ideal when negative-class performance is equally important.
1️⃣3️⃣ Error Rate
๐ Use
✅ Advantages
• Directly shows the proportion of wrong predictions.
❌ Disadvantages
• Can be misleading with imbalanced datasets.
No comments:
Post a Comment