Let's take a closer look at how you can measure the performance of a classification model using a confusion matrix. To understand how a confusion matrix works, let's create a confusion matrix for a binary classification model that predicts whether a credit card transaction was normal or fraudulent:
Actual fraud | Actual normal | |
Predicted fraud | True positive |
False positive |
Predicted normal | False negative |
True negative |
The sample confusion matrix contains two columns and two rows. We have a column for the class fraud and a column for the class normal. We've added rows to the fraud and normal classes as well. The cells in the table will contain numbers that tell us ...