Skip to content
Lesson 3 · Foundations

What is training data?

Training data is the set of examples a model learns from: photos, emails, sentences or songs, usually with a label saying the right answer for each one. It is the model's textbook. What is in that data decides what the model learns, good habits and bad ones alike.

Scroll

The model's entire world

A model never sees the real world. It only sees its training data, so that data is its whole world. Training data is a collection of examples, and a collection like that is called a dataset. For a spam filter, the dataset is thousands of emails, each marked spam or not spam. For a music app, it is what millions of people played and skipped. For a chatbot, it is a giant pile of text from the internet and books. Whatever is common in the data becomes normal to the model. Whatever is missing, the model simply does not know exists.

More is good, better is better

You might think the only rule is "more data". More does help, and modern models eat enormous amounts. But quality matters more than quantity. Imagine a dataset where one photo in ten is marked wrong: a dog marked cat. The model will learn from those mistakes just as faithfully as from the correct ones. Variety matters too. Ten thousand clean, varied examples beat a million messy copies of the same thing. Programmers have a blunt phrase for this: garbage in, garbage out.

A score, then a line

Many models are classifiers: they sort things into groups, such as spam or not spam. A classifier does not answer with a plain yes or no. It gives a score, something like "this email looks 83 percent spam-like". Someone has to turn that score into a decision. The tool for that is a threshold: a line, drawn at a chosen score. Anything above the line is called spam and goes to the junk folder. Anything below goes to your inbox. Move the line and the decisions change, even though the model did not.

Two ways to be wrong

MistakeWhat it meansIn your inbox
False alarmFlagging something harmlessA friend's party invite lands in spam
MissLetting a bad one throughA scam email reaches you
The trade-offFewer of one means more of the otherWhere you draw the line decides which you get

A smoke alarm

A smoke alarm is a classifier with a threshold. Set it very sensitive and it screams at burnt toast: lots of false alarms. Set it lazy and it stays quiet through a real fire: a miss. No setting gives you zero of both. You choose which mistake hurts less. For a smoke alarm, false alarms are annoying but a miss is deadly, so you keep it sensitive. A spam filter makes the opposite choice, because losing a real email hurts more than seeing one junk message.

Bad data teaches bad habits

If the examples are lopsided, the model copies the lopsidedness. A face-unlock model trained mostly on one group of people works worse for everyone else. It is not being unfair on purpose. It simply never learned the rest. This is called bias, and lesson 7 returns to it. Next: where inside the model does all this learning actually live?

InteractiveDrag the threshold line (or use the slider). Anything scored above it is called spam. Watch the mistakes change.

Check yourself · 3 quick questions

  1. Why is training data described as the model's whole world?

    Show answer

    Because the model only ever sees those examples, and nothing else — A model never sees the real world; whatever is common in its data becomes normal to it, and whatever is missing it does not know exists.

  2. A spam filter moves its threshold so that fewer real emails land in spam. What else changes?

    Show answer

    More spam gets through to the inbox — Fewer false alarms means more misses: moving the line trades one kind of mistake for the other.

  3. A face-unlock model works well for one group of people and badly for others. What is the most likely cause?

    Show answer

    The training data was lopsided toward one group — A model copies whatever its data looks like; if one group was rare in the examples, the model never properly learned them. That is bias.