Precision and Recall in Machine Learning: A Jaffna Tea Shop Story

Understand precision and recall in machine learning with a Jaffna tea shop analogy. Learn how to optimize for accuracy and minimize errors.

P
Parathan Thiyagalingam
December 24, 20253 min read
Precision and Recall in Machine Learning: A Jaffna Tea Shop Story

Machine learning often feels full of abstract formulas, but what if we explain it through something familiar? Imagine you’re running a popular tea shop near the Jaffna Library. Your specialty? The famous palmyrah jaggery tea.

Every day, you want to predict:

👉 Will this customer order palmyrah jaggery tea?

This is exactly like how machine learning models make predictions. Let’s break it down step by step.

The Prediction Problem

For each customer, you try to guess whether they’ll order the special tea.

  1. Yes (Positive) → Customer orders palmyrah jaggery tea
  2. No (Negative) → Customer orders regular tea

But just like in ML, your predictions don’t always match reality.

The Four Possible Outcomes

When customers come in, four things can happen:

  1. True Positive (TP) → You predict yes and the customer really orders palmyrah tea ✅
  2. False Positive (FP) → You predict yes but the customer actually wants regular tea ❌
  3. True Negative (TN) → You predict no and the customer really wants regular tea ✅
  4. False Negative (FN) → You predict no but the customer actually wanted palmyrah tea ❌

These four outcomes form the basis of precision and recall.

Precision: “When I say YES, how often am I right?”

  1. Definition: Out of all the customers you predicted would order palmyrah tea, how many actually did?
  2. Formula: Precision = TP ÷ (TP + FP)

Example from Jaffna:

  1. You made palmyrah tea for 10 customers today.
  2. 8 really wanted it, 2 didn’t.
  3. Precision = 8 ÷ 10 = 80%

Why it matters:

  1. High precision = less waste of expensive palmyrah jaggery
  2. Customers are less annoyed by wrong orders
  3. Useful when the special ingredient is costly or scarce

Recall: “How many palmyrah tea lovers did I actually catch?”

  1. Definition: Out of all the customers who actually wanted palmyrah tea, how many did you correctly serve?
  2. Formula: Recall = TP ÷ (TP + FN)

Example from Jaffna:

  1. 15 customers wanted palmyrah tea today.
  2. You correctly served 12 of them.
  3. You missed 3 (gave them regular tea).
  4. Recall = 12 ÷ 15 = 80%

Why it matters:

  1. High recall = you don’t miss many specialty tea lovers
  2. Improves your reputation as the palmyrah jaggery tea shop in Jaffna

High Precision, Low Recall → The Careful Shop Owner

  1. You serve palmyrah tea only when you’re 100% sure.
  2. Almost no mistakes (no waste).
  3. But many tea lovers leave disappointed.

Like a shop near Nallur temple that only serves special tea to a certain group—accurate, but misses many real fans.

High Recall, Low Precision → The Enthusiastic Shop Owner

  1. You serve palmyrah tea to almost everyone.
  2. Most palmyrah lovers are happy.
  3. But you waste jaggery on wrong guesses.

Like a new owner who assumes every village customer wants palmyrah tea—captures most lovers, but wastes ingredients.

  1. Focus on Precision → When jaggery is expensive (e.g., during drought season)
  2. Focus on Recall → When you want to build a strong reputation as the go-to shop for traditional tea

A Balanced Approach

The smartest shop owners will find a balance:

  1. Watch for curious customers studying the menu
  2. Notice those asking about “traditional” items
  3. Serve families with elders who appreciate cultural flavors

This way, they catch most palmyrah lovers without too much waste.

In machine learning, precision and recall are like running a Jaffna tea shop.

  1. Precision asks: “When I predict YES, how often am I right?”
  2. Recall asks: “Out of all real YES cases, how many did I catch?”

Whether you care more about jaggery wastage (precision) or customer happiness (recall) depends on your goals.

Just like serving tea, building ML models is about finding the right balance.