Confusion matrix: Difference between revisions
From WikiMD's Wellness Encyclopedia
CSV import |
CSV import |
||
| Line 76: | Line 76: | ||
[[Category:Evaluation methods]] | [[Category:Evaluation methods]] | ||
{{No image}} | {{No image}} | ||
__NOINDEX__ | |||
Latest revision as of 08:08, 17 March 2025
Confusion Matrix[edit]
A confusion matrix is a specific table layout that allows visualization of the performance of an algorithm, typically a supervised learning one. It is a tool often used in the field of machine learning and statistics to evaluate the accuracy of a classification model.
Structure of a Confusion Matrix[edit]
A confusion matrix is a square matrix that compares the actual target values with those predicted by the model. It is composed of four key components:
| Actual \ Predicted | Positive | Negative |
|---|---|---|
| Positive | True Positive (TP) | False Negative (FN) |
| Negative | False Positive (FP) | True Negative (TN) |
- True Positive (TP): The number of instances that are correctly predicted as positive.
- False Positive (FP): The number of instances that are incorrectly predicted as positive.
- True Negative (TN): The number of instances that are correctly predicted as negative.
- False Negative (FN): The number of instances that are incorrectly predicted as negative.
Metrics Derived from a Confusion Matrix[edit]
Several important metrics can be derived from the confusion matrix, which are crucial for understanding the performance of a classification model:
- Accuracy: The proportion of the total number of predictions that were correct.
: Accuracy = \( \frac{TP + TN}{TP + FP + TN + FN} \)
- Precision: The proportion of positive identifications that were actually correct.
: Precision = \( \frac{TP}{TP + FP} \)
- Recall (also known as Sensitivity or True Positive Rate): The proportion of actual positives that were identified correctly.
: Recall = \( \frac{TP}{TP + FN} \)
- Specificity: The proportion of actual negatives that were identified correctly.
: Specificity = \( \frac{TN}{TN + FP} \)
- F1 Score: The harmonic mean of precision and recall, providing a balance between the two.
: F1 Score = \( 2 \times \frac{Precision \times Recall}{Precision + Recall} \)
Applications[edit]
Confusion matrices are widely used in various fields such as:
- Healthcare: To evaluate the performance of diagnostic tests.
- Finance: To assess the accuracy of credit scoring models.
- Marketing: To measure the effectiveness of customer segmentation models.
Limitations[edit]
While confusion matrices provide a comprehensive overview of a model's performance, they have limitations:
- They do not provide a single measure of performance, which can make comparisons between models difficult.
- They are not useful for imbalanced datasets, where the number of instances in different classes varies significantly.
See Also[edit]
References[edit]
- ,
Pattern Recognition and Machine Learning, Springer, 2006, ISBN 978-0-387-31073-2,
- ,
An introduction to ROC analysis, Pattern Recognition Letters, 2006, Vol. 27(Issue: 8), pp. 861–874, DOI: 10.1016/j.patrec.2005.10.010,