What is Overfitting in Machine Learning?

You've probably met this student in school.
They memorise every past exam paper. Every answer, every exact phrasing. Come exam day — if the question is identical, they ace it. But change one word? They're lost.
That student is an overfitted machine learning model.
What is Overfitting?
When you train an ML model, you feed it historical data — examples it can learn from. Overfitting happens when the model learns the training data too well. It picks up not just the real patterns, but also the noise — the random quirks and exceptions that won't repeat in the real world.
The result? Brilliant performance on training data. Poor performance on anything new.
A Simple Example
Say you're building a model to predict ship delays based on weather. You have 3 years of data. An overfitted model might learn that every time the sea state was 4.2m on a Tuesday in March, the ship was delayed — a coincidence in your data, not a real rule. Next time there's a 4.2m sea state on a Wednesday? The model fails.
How Do You Spot It?
Training accuracy: very high (95%+). Test accuracy: noticeably lower (70%?). A big gap between the two is your overfitting red flag.
How Do You Fix It?
Get more training data. Simplify the model with fewer features. Use regularisation — a technique that penalises complexity. Apply cross-validation to test on multiple unseen subsets.
Overfitting is one of the most common reasons ML models fail in production — and one of the first things every practitioner learns to watch for.
Join our daily AI/ML learning community: https://chat.whatsapp.com/DhaGgTuQ9GE67ykGVMgxXb



Comments