Confusion Matrix
Enter the values from your classification model:
Understand classification model performance with interactive confusion matrix analysis
Enter the values from your classification model:
A confusion matrix is a table used to evaluate the performance of a classification model. It shows the counts of actual vs. predicted classifications, helping you understand where your model is making mistakes.
True Positive (TP): Model correctly predicted positive class
True Negative (TN): Model correctly predicted negative class
False Positive (FP): Model incorrectly predicted positive (Type I Error)
False Negative (FN): Model incorrectly predicted negative (Type II Error)
Accuracy: Overall correctness of the model. Good for balanced datasets.
Precision: Of all positive predictions, how many were actually positive? Important when false positives are costly.
Recall (Sensitivity): Of all actual positives, how many did we catch? Important when false negatives are costly.
F1 Score: Harmonic mean of precision and recall. Useful for imbalanced datasets.
Specificity: Of all actual negatives, how many did we correctly identify?
Use Precision when: False positives are expensive (e.g., spam detection - marking important email as spam is bad)
Use Recall when: False negatives are expensive (e.g., disease diagnosis - missing a disease is dangerous)
Use F1 Score when: You need a balance between precision and recall
Use Accuracy when: Classes are balanced and all errors are equally bad
• Medical Diagnosis: High recall is critical - you don't want to miss sick patients
• Spam Detection: High precision is important - don't mark important emails as spam
• Fraud Detection: Balance needed - catch fraud but don't block legitimate transactions
• Quality Control: Depends on cost of defects vs. cost of inspection