Actual Value | Predicted Value |
---|---|
1 | 1 |
0 | 1 |
0 | 0 |
1 | 0 |
Step-by-Step Procedure to Create a Confusion Matrix
The following steps can be followed to create a confusion matrix:
- Create a 2×2 matrix with the rows and columns representing the actual and predicted values.
- Count the number of true positives, true negatives, false positives, and false negatives.
- Fill in the values in the matrix.
Using the example values above, the confusion matrix would look like:
Predicted 0 | Predicted 1 | |
---|---|---|
Actual 0 | 1 (True Negative) | 1 (False Positive) |
Actual 1 | 1 (False Negative) | 1 (True Positive) |
Evaluation Metrics
Now that we have created a confusion matrix, we can use it to calculate various evaluation metrics such as accuracy, precision, recall, and F1 score.