Understanding Type 1 and Type 2 Errors
In statistical hypothesis testing, two types of errors can occur: Type 1 error and Type 2 error.
Type 1 Error (False Positive)
A Type 1 error occurs when we reject a true null hypothesis. This means that a test indicates a positive result when, in fact, there is none.
Example: A medical test incorrectly diagnosing a patient as having a disease when they are actually healthy.
Type 2 Error (False Negative)
A Type 2 error occurs when we fail to reject a false null hypothesis. This means that a test indicates a negative result when, in fact, there is a positive condition present.
Example: A medical test incorrectly diagnosing a patient as healthy when they actually have the disease.
Confusion Matrix
A confusion matrix is a table that is often used to describe the performance of a classification model. It compares the predicted classifications with the actual classifications.
Structure of the Confusion Matrix
Predicted Positive | Predicted Negative | |
---|---|---|
Actual Positive | True Positive (TP) | False Negative (FN) |
Actual Negative | False Positive (FP) | True Negative (TN) |
Example of a Confusion Matrix
Consider a model that classifies emails as spam or not spam. Below is an example of a confusion matrix for 100 emails:
Predicted Spam | Predicted Not Spam | |
---|---|---|
Actual Spam | 45 (TP) | 5 (FN) |
Actual Not Spam | 10 (FP) | 40 (TN) |
Summary of Errors
- Type 1 Error (False Positive): Incorrectly classifying a not spam email as spam (FP = 10).
- Type 2 Error (False Negative): Failing to classify a spam email as spam (FN = 5).
Understanding these errors is crucial in evaluating the performance of classification models, as they can have significant implications depending on the context.
Thanks for your feedback