(From Confused Developer to Building Real ML Systems — Part 5)
I finally did it.
I trained a machine learning model that showed:
Actually… I was confident.
I thought:
I was wrong.
New data.
Real input.
And suddenly…
Badly.
Predictions were wrong.
Completely unreliable.
But how?
That’s when I learned something no tutorial explained clearly:
And it lies more often than you think.
Let’s say you’re building a spam detection system.
Your dataset looks like this:
Now imagine your model does this:
👉 Predicts “NOT spam” for everything
Accuracy?
But is it useful?
from sklearn.metrics import accuracy_score
# Actual values
y_true = [0, 0, 0, 0, 0, 1] # 1 = spam
# Model predictions (predicts all 0)
y_pred = [0, 0, 0, 0, 0, 0]
print(accuracy_score(y_true, y_pred))
Output:
Looks good.
But the model completely ignored spam.
This is called:
Where one class dominates the others.
And accuracy becomes misleading.
I trusted one number:
I didn’t ask:
After this failure, I discovered better ways to evaluate models:
👉 How many predicted positives are correct?
👉 How many actual positives did we catch?
👉 Balance between precision & recall
from sklearn.metrics import classification_report
print(classification_report(y_true, y_pred))
This shows:
👉 The real performance of your model
When I started using better metrics:
Not just visually.
Machine learning is not about:
It’s about:
Before:
Now:
In real systems:
👉 A “high accuracy but wrong model” can be dangerous
Whenever I see accuracy, I ask:
Now that you understand why accuracy can mislead you…
It’s time to fix it properly:
If you’re learning machine learning the real way:
👉 Follow this series
👉 Learn from mistakes, not just theory
Next Part: Train vs Test Split — The Mistake That Fooled Me 🚀
I Got 95% Accuracy… And It Was Completely Useless was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.

![[Rappler’s Best] Unintended consequences](https://www.rappler.com/tachyon/2026/04/2026-04-12T014523Z_1199031946_RC2DNKAJDOHS_RTRMADP_3_IRAN-CRISIS-PAKISTAN-scaled.jpg?resize=75%2C75&crop_strategy=attention)
