Performance Metrics
In the case of classification algorithms, we use a confusion matrix, which gives us the performance of the learning algorithm. It is a square matrix that counts the number of true positive (TP), true negative (TN), false positive (FP), and false negative (FN) outcomes.
True positive: The number of cases that were observed and predicted as 1.
False negative: The number of cases that were observed as 1 but predicted as 0.
False positive: The number of cases that were observed as 0 but predicted as 1.
True negative: The number of cases that were observed as 1 but predicted as 0.
Precision
It is the ability of a classifier to not label a sample that is negative as positive. The precision for an algorithm is calculated using the following formula:
This is useful in the case of email spam detection. In this scenario, we do not want any important emails to be detected as spam.
Recall
It refers to the ability of a classifier to...