Precision vs. Recall Simplified

Scenario: Pulling Puppies and Snakes out of a Bag

Imagine you have a bag containing both puppies and snakes. Your task is to build a model to help you predict whether the next animal you’re about to pull is a puppy or a snake. Do you optimize for Precision or Recall?

Precision

Precision in this scenario would mean the accuracy of your puppy-pulling process. It's about ensuring that every time you pull something out thinking it's a puppy, it really is a puppy and not a snake.

Example: You pull out 10 animals, and 8 of them are puppies while 2 are snakes.

Precision = Correctly Identified Puppies (True Positives) / Total Identified as Puppies (True Positives + False Positives)

Precision = 8/10 = 0.8 or 80%

This means that 80% of the animals you identified as puppies were actually puppies.

Recall

Recall is about ensuring you get all the puppies out of the bag. It measures how many of the actual puppies you successfully identified and pulled out.

Example: There are 12 puppies in the bag, and you pull out 8 puppies, leaving 4 in the bag.

Recall = Correctly Identified Puppies (True Positives) / Total Actual Puppies (True Positives + False Negatives)

Recall = 8/12 ≈ 0.67 or 67%

This means you were able to correctly identify and pull out about 67% of all the puppies in the bag.

Bottom line

If you’re trying to save the puppies you’re optimizing for recall

If you’re trying to save yourself you’re optimizing for precision