From examples to predictions
Get clear on what it means to train on data, what a model actually learns, and why different problems require different learning setups.
Before We Begin
Traditional programming writes the rule first and runs it on data. Machine learning flips that arrangement: we provide examples, define the outcome we care about, and let the system fit a rule that works well on similar future cases. This lesson gives students the vocabulary to talk about that shift precisely.
How this lesson fits
This module is where the course shifts from explicit rules to learned patterns. Instead of telling the machine exactly what to do in every case, we give it examples, define success, and let it infer a decision rule from the data.
The big question
How can a machine study examples, extract useful patterns, and make predictions on cases it has never seen before?
Why You Should Care
This lesson is the skeleton behind most modern AI products: data comes in, a model is trained, and predictions come out. Once students can name those moving parts, the rest of the field becomes easier to reason about and critique.
Where this is used today
Think of it like this
It is like teaching by worked examples rather than by one perfect lecture. The learner studies many past cases, notices recurring patterns, and gradually becomes better at handling new ones that resemble what it has seen before.
Easy mistake to make
A model that learns patterns from data is not automatically understanding the world the way a person does. Strong performance and human-like understanding are not the same thing.
Think about this first
Name a task that would be painful to hand-code rule by rule but manageable if you had thousands of examples. What makes the example-based approach better?
Words we will keep using
Here is the simplest way to think about machine learning: instead of writing every rule by hand, you give the computer examples and let it discover a useful pattern. That is why ML is powerful on tasks where hand-written rules would be too long, too fragile, or too hard to invent.
This is one of the cleanest ML examples. We show the model points, and it tries to draw the line that matches them as well as possible. The red segments show the mistakes. The blue line is the model's best attempt.
Try dragging the Noise slider. Notice how the dots scatter. The model struggles to find a clean line when the data gets messy.
Imagine you have 10,000 emails already marked as โSpamโ or โNot Spam.โ You want to train a model to spot spam in the future. What kind of machine learning is that?