Confusion Matrix For binary classification
A 2X2 Confusion matrix is shown below for the image recognition having a Dog image or Not Dog image.
| Actual | ||
---|---|---|---|
Dog | Not Dog | ||
Predicted | Dog | True Positive | False Positive |
Not Dog | False Negative | True Negative |
- True Positive (TP): It is the total counts having both predicted and actual values are Dog.
- True Negative (TN): It is the total counts having both predicted and actual values are Not Dog.
- False Positive (FP): It is the total counts having prediction is Dog while actually Not Dog.
- False Negative (FN): It is the total counts having prediction is Not Dog while actually, it is Dog.
Example for binary classification problems
Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
Actual | Dog | Dog | Dog | Not Dog | Dog | Not Dog | Dog | Dog | Not Dog | Not Dog |
Predicted | Dog | Not Dog | Dog | Not Dog | Dog | Dog | Dog | Dog | Not Dog | Not Dog |
Result | TP | FN | TP | TN | TP | FP | TP | TP | TN | TN |
- Actual Dog Counts = 6
- Actual Not Dog Counts = 4
- True Positive Counts = 5
- False Positive Counts = 1
- True Negative Counts = 3
- False Negative Counts = 1
| Predicted | ||
---|---|---|---|
Dog | Not Dog | ||
Actual | Dog | True Positive | False Negative |
Not Dog | False Positive | True Negative |
Confusion Matrix in Machine Learning
In machine learning, classification is the process of categorizing a given set of data into different categories. In machine learning, to measure the performance of the classification model, we use the confusion matrix. Through this tutorial, understand the significance of the confusion matrix.