Just building a model does not suffice; we need to make sure that our model functions well and gives us a good and accurate output. To do this, we need to understand some classification metrics that will be used to evaluate the model throughout this book.
Let's begin by defining some building blocks of the metrics that will be used to evaluate the classification models. To do this, take a simple example of spam detection that is done by any online mailbox for reference. A spam email shall be considered to be of a positive class and the normal email to be of a negative class. We can summarize this spam detection model into four categories, which are illustrated in the following matrix:
True positives (TP) | False positives (FP) |
Reality: Email is spam | Reality: Email is NOT spam |
Model Prediction: Email is spam | Model Prediction... |