Why Accuracy Isn’t Everything: Precision and Recall Simply Explained (2024)

Why Accuracy Isn’t Everything: Precision and Recall Simply Explained (3)

A common question in Data Science interviews is ‘How would you measure the performance of a classification model when 99% of your data belongs to one class?’

This is a straightforward question, yet many people stumble and don’t know how to respond.

In this article we will explore the answer to the above question by discussing Recall, Precision and the harmonic mean of the two, the F1 score.

But first, make sure to subscribe to my YouTube Channel!

Click on the link for video tutorials that teach you core data science concepts in a digestible manner!

Lets begin with explaining why accuracy may not be a good measure. If 99% of your dataset belongs to one class, then by simple guessing, any model could achieve an accuracy score of 99%!

The model will simply learn really well to predict that single class, hence achieve an accuracy score which is equal to the distribution of classes.

Even without a Machine Learning model, I can purely guess what class a sample belongs to and achieve an accuracy of 99%!

Therefore, for this particular problem accuracy is not a good metric to measure model performance. Hence, we have to seek alternative measurements.

Note: Sometimes accuracy is a good measure, but it all depends on the context of the work.

Before we continue, it is important to understand the Confusion Matrix. This breaks down your results into correct and incorrect classifications for both classes and is more informative in measuring performance than just accuracy.

Why Accuracy Isn’t Everything: Precision and Recall Simply Explained (2024)
Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 5524

Rating: 4 / 5 (51 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.