Precision, recall, and F1
In some cases, accuracy values are deceiving: they suggest that the classifier is good, although it is not. For example, suppose we have an unbalanced dataset: there are only 1% of examples that are positive, and the rest (99%) are negative. Then, a model that always predicts negative is right in 99% of the cases, and hence will have an accuracy of 0.99. But this model is not useful.
There are alternatives to accuracy that can overcome this problem. Precision and recall are among these metrics, as they both look at the fraction of positive items that the model correctly recognized. So, if we have a large number of negative examples, we can still perform some meaningful evaluation of the model.
Precision and recall ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access