Data Science Metrics Explained With Strawberries š
--
Accuracy, precision, and recall explained through strawberries and agritourism
Last weekend I went to Tanaka Farms to pick strawberries. It was very fun and I really enjoyed it (not a paid endorsement btw). I picked one box of strawberries and one bag of carrots. Both were very delicious.
While out in the beautiful Southern California weather, I realized that picking strawberries is a great metaphor for classifier algorithms from data science and in particular the success metrics.
I always forget the exact meanings of accuracy, precision, and recall. So why not explain with strawberries? Itās a fun example that really brings these ideas to life. It also forms a strong emotional memory ā who doesnāt love strawberriesāthat makes the concepts easy to remember.
Metrics Recap
Hereās a quick recap of the important classifier metrics:
Now letās apply it to strawberry picking. Letās start by defining the classes:
- Positive = The strawberry is ripe (pick it)
- Negative = The strawberry is not ripe (leave it)
Letās also define the algorithms. Weāll call my eye+brain the predictive algorithm. These metrics are measuring how good my eye+brain is at classifying strawberries as good or bad.
My friend is much better than me at cooking. So weāll call their eye+brain estimation as the actual class of the strawberry, as they double check the strawberries before we actually use them.
Accuracy
Accuracy measures the overall correctness of a model by comparing the number of correct predictions (true positives and true negatives) with the total number of predictions made. For strawberries, itās quite simply my overall ability to pick good onesā¦