Illustration
Upgrade now
Illustration
Upgrade now

Overfitting

Summary:
Overfitting

What is overfitting?

Overfitting happens when a machine learning model matches its training data so closely that it fails to make correct predictions on new data. Instead of learning the general pattern, the model memorizes the specific examples it was shown, including their quirks.

It's like a student who learns last year's exam answers by heart. That student scores well on last year's paper and then struggles with a new one, because they never learned the subject itself. Google's Machine Learning Crash Course uses a similar picture: an overfit model is like an invention that works well in the lab but is worthless in the real world.

The opposite quality is called generalization: a model's ability to make correct predictions on new, previously unseen data. A model that generalizes well is the goal of training.

What causes overfitting?

Google's crash course names 2 main causes:

  • The training data doesn't represent real-life data well. If every example comes from a narrow group of users, situations, or devices, the model learns that narrow slice and little else.
  • The model is too complex for the problem. A very flexible model can bend itself around every training example, noise included, instead of finding the simpler pattern underneath.

In Google's tree example, a complex model did a great job on the training set and a poor job on the test set. A test set is separate data held back to check how the model handles examples it hasn't seen. That gap between the 2 scores is the typical sign of overfitting.

How does overfitting differ from underfitting?

Underfitting is the opposite problem. An underfit model doesn't even make good predictions on its training data, because it's too simple or hasn't learned enough. In Google's analogy, it's like a product that doesn't even do well in the lab.

So the 2 failures look different in testing:

  • An overfit model scores high on the examples it trained on and low on new ones.
  • An underfit model scores low on both.

A well-fitted model sits between them. It does well on the training data and almost as well on data it has never seen.

Why does overfitting matter for product teams?

An overfit model can pass internal testing and still disappoint real users. If the people, phrasing, or situations in real use look a little different from the training data, accuracy drops, and the team may not notice until complaints arrive. A model trained mostly on a single region's users, for example, may stumble on other accents, spellings, or shopping habits.

That's why a single average accuracy score can mislead. Product and design teams can ask what data a model was trained and tested on, and whether that data looks like the full range of people who will use the feature. Testing with realistic inputs from different groups catches problems that a lab score hides.

The AI Fundamentals for UX course covers overfitting alongside the other limits designers need to plan for when working with AI.

Frequently Asked Questions

Does overfitting mean a model is too good?
How do teams spot overfitting?
Is overfitting the same as bias in AI?
Avatars

Join 500,000+ product professionals leveling up with Uxcel

Interactive learning built for busy professionals. Advance your UX design or product management career in just 5 minutes a day.
Icon

Over 60 courses

Icon

Recognized certificates

Icon

Career paths & more

Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo
Stars

Successfully transforming people’s careers & lives

4.8/5
Avatars

10,000+ verified public & course reviews

Photo

With Uxcel, I've gained so much confidence talking with clients.

Blake Feldman
Product Designer · 15+ years in design
Photo

Uxcel helped me level up from a junior to a senior designer

Chieri Wada
UX/UI Designer · 8+ years in design
Photo

Uxcel really helped me during my career change.

Ryan Blackwell
UX Designer & Writer · 5+ years in design
Photo

Uxcel is in my browser favorites, I use it for a ton of stuff.

Matt Salik
UX designer · 20+ years in design
Photo

Love the certifications, love the price. Thumbs up Uxcel.

Phil Campbell
Information Architect · 1 year in design