Skip to main content
HT
HerbDev Application Rescue
← Learning hub

Free guided course · ML 101

Generalization and overfitting

Diagnose a gap between fitting examples and handling new ones.

Beginner · Lesson 5 of 6 · About 8 minutes · No account needed

  • ML 101
  • Practical examples
  • Self-paced learning

Your learning progress

0 of 6 checkpoints complete · Best score: 0 of 18

0 of 6

Accept the cookie notice to save scores and progress on this browser. You can learn and score without accepting; unsaved progress ends when you leave the page.

Answer all three questions correctly to complete a checkpoint. Retry as often as you like; your best score counts. Scores stay on this browser and can be cleared. They do not transfer between devices.

Start the first lesson →

Learn · Try · Check

What you’ll learn

Diagnose a gap between fitting examples and handling new ones.

Listen to this lesson

Local AI narration · Quiz answers are kept out of the audio.

Read the audio transcript

ML 101. Generalization and overfitting. Diagnose a gap between fitting examples and handling new ones. Learning the training set is not the whole goal. Generalization means useful performance on new examples from the intended setting. Overfitting occurs when a model fits details of training data that do not transfer well. High training performance alongside much weaker independent validation performance is a warning sign. It is not a complete diagnosis: different data conditions, label problems or leakage in the evaluation process also need investigation. Compare with a baseline. A baseline is a simple reference approach under the same evaluation conditions. It can be a fixed rule, a majority-class predictor or a small model. If a more complex model cannot improve the outcome that matters, complexity has not earned its place. Options for improving generalization include better data, simpler models, regularization and stopping training based on validation behavior. Apply them as controlled experiments, not as a checklist that guarantees success. Look at where the errors happen. An average can hide weak performance on a particular device, lighting condition or capture site. Inspect meaningful groups as well as the overall metric. A model evaluated on bright images may perform poorly on low-light images encountered later. That change in input conditions is one form of distribution shift. Keep monitoring after release because the deployment environment can change even when the model file stays the same. HerbDev example. HerbDev’s guide compares model choices around workflow, memory, latency and evidence. A larger model is not automatically the best deployment decision. Compare it with a smaller baseline using the same task and evaluation procedure. The process: Fit on training data. Then Compare independent results. Then Inspect groups and mistakes. Then Change one factor. Try this. A model scores 99% on training examples and 65% on validation examples. Name two investigations before buying a larger model. Pause the audio to try the exercise. A worked answer and checkpoint questions are available on the lesson page.

Learning the training set is not the whole goal

Generalization means useful performance on new examples from the intended setting. Overfitting occurs when a model fits details of training data that do not transfer well. High training performance alongside much weaker independent validation performance is a warning sign. It is not a complete diagnosis: different data conditions, label problems or leakage in the evaluation process also need investigation.

Compare with a baseline

A baseline is a simple reference approach under the same evaluation conditions. It can be a fixed rule, a majority-class predictor or a small model. If a more complex model cannot improve the outcome that matters, complexity has not earned its place. Options for improving generalization include better data, simpler models, regularization and stopping training based on validation behavior. Apply them as controlled experiments, not as a checklist that guarantees success.

Look at where the errors happen

An average can hide weak performance on a particular device, lighting condition or capture site. Inspect meaningful groups as well as the overall metric. A model evaluated on bright images may perform poorly on low-light images encountered later. That change in input conditions is one form of distribution shift. Keep monitoring after release because the deployment environment can change even when the model file stays the same.

The process, step by step
  1. Fit on training data
  2. Compare independent results
  3. Inspect groups and mistakes
  4. Change one factor

Try it yourself

A model scores 99% on training examples and 65% on validation examples. Name two investigations before buying a larger model.

Compare with a worked answer

Check for overfitting and inspect whether validation labels or capture conditions differ from training. Compare a simpler baseline on the same split. More model capacity is not an automatic fix for the observed gap.

Check your understanding

Choose one answer for each question, then check your score. Read the explanations and retry any question you missed.

1. What is a warning sign of possible overfitting?

2. What makes a baseline useful?

3. A model trained on bright images encounters mostly low-light images. What should you examine?

Read the answer guide

1. Much stronger training than independent validation performance A large training–validation gap can indicate overfitting, though the data and evaluation process also need checking.

2. It provides a reference under comparable conditions A baseline tells you whether additional complexity improves the chosen outcome under the same evaluation conditions.

3. Performance under the changed input conditions Deployment inputs may differ from development inputs. Evaluate that shift rather than assuming the old score still applies.

Was this explanation clear?

Help improve this lesson. With cookies accepted, HerbDev records one current rating per lesson for this browser. Server checks limit repeated submissions; accepted changes may also appear in site analytics. No written answer or account is needed.

You can also share a suggestion with HerbDev.

Review missed questions

Revisit questions missed on your latest checkpoint attempts. These short reviews help you practise; they do not change your best checkpoint scores. Return to the lesson checkpoint when you are ready.

Check a lesson’s answers to build your review list. Saved reviews are available after cookie acceptance.

Keep exploring: What next? · AI vocabulary · AI 101 · Learning hub

Manage browser learning data

“Remove my test data” clears all AI 101 and ML 101 scores, reviews, project checklists and rating selections, plus saved vocabulary and recent history in this browser. Test entries cannot be separated from other learning progress. Cookie preferences, security protections, submitted feedback, contact emails and past analytics are kept.