Let’s talk about Metrics

Gordon Chen
Nov 6 · 3 min read

What is the best measurement of success for your recommendation system or your linear regression model? Well the answer is tricky. It all depends on the data that is in question and the question being asked.

Let’s take a look at 4 metrics commonly used in data science:

  • Accuracy
  • Precision
  • Recall
  • F1-Score

Accuracy

Let’s first talk about the Accuracy. By definition, accuracy is the number of correct predictions divided by the total number of predictions.

Accuracy is a very simple and useful metric to use when evaluating a binary classification problem. It can also be seen as the number True Positive + True Negative divided by all predictions as shown by the formula below.


Precision

Now Precision and Recall are usually look at as a combination but I will firstly talk about Precision. It basically measures how accurate our positive predictions are. More specifically, precision measures the True Positives divided by True Positives + False Positives.

False positives occur when our model incorrectly labels actual negatives as positives. What Precision does is it provides the proportion of relevant predicted data points that are actually relevant.


Recall

Conversely, Recall measures the false negatives against the true positives. Recall is defined by the True Positives divided by the True Positives + False Negatives.

This metric aims to highlight data points that are were incorrectly labeled as negative when they are actually positives. Metrics like Recall are especially important for safety concerns such as disease detection.


F1-Score

Lastly, we have the F1-Score which aims to balance achieving high precision and high recall. F1-Score is defined as 2 times the product of Recall and Precision divided by the sum of Recall and Precision.

This metric focuses on highlighting the importance of False Positives and False Negatives and less so on True Negatives. The reason a harmonic mean is used in this equation as oppose to an arithmetic mean is the stability of harmonic mean when dealing with outliers in the data. I hope this outlines and clarifies any confusion on the 4 commonly used metrics for Data Science.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade