"Instead of programming the answer, you show the computer examples and let it work out the pattern. That flip is machine learning."
Level: Beginner · Time: ~13 min · Prerequisites: Modules 1–2
Learning Objectives
By the end of this module, you will be able to:
- Explain how machine learning differs from normal programming
- Name the three main types of ML
- Define features, labels, training, and prediction
- Follow the basic ML workflow
1. The Big Flip
In traditional programming, a human writes the rules: Rules + Data → Answers. In machine learning, we flip it: Data + Answers → Rules. You feed the computer examples (data) along with the correct answers, and it learns the rules — a bundle we call a model.

Once trained, the model takes new data and predicts an answer. The subtle magic is that nobody ever tells the model the rule directly — it discovers one that fits the examples. Show it a thousand houses with their sizes and prices, and it works out roughly "price rises with size" on its own, then applies that to a house it has never seen.
Explain like I'm new: Teaching a child "cat" by pointing at many cats — never by listing rules like "four legs, whiskers" — is machine learning. After enough examples, they recognize a cat they've never seen. The model does the same.
2. Three Types of Machine Learning
| Type | You give it… | It learns to… | Example |
|---|---|---|---|
| Supervised | Examples with answers (labels) | Predict the answer | Spam / not spam |
| Unsupervised | Examples without answers | Find hidden groups | Customer segments |
| Reinforcement | An environment + rewards | Act to maximize reward | Game-playing agents |
Supervised learning is the most common starting point, and it splits into regression (predict a number) and classification (predict a category). "How much will this house sell for?" is regression — the answer is a number on a scale. "Is this email spam or not?" is classification — the answer is one of a few fixed buckets. Spotting which of the two you're facing is often the first decision in a real project.
Key idea: The type of ML you use depends on your data. Have labeled answers? Supervised. Just raw data to explore? Unsupervised. A goal to achieve through trial and error? Reinforcement.
3. The Vocabulary: Features & Labels
- Features (X): the input clues — a house's size, rooms, location.
- Label (y): the answer to predict — the house's price.
- Training: the model studies many (features → label) examples.
- Prediction (inference): the trained model estimates the label for new features.
Real-world use case: A bank predicts loan default risk. Features = income, credit history, loan amount; label = "defaulted: yes/no" from past loans. The model learns the pattern and scores new applicants — a supervised classification task running millions of times a day.
4. The ML Workflow
Every ML project follows the same rhythm:
- Ask a clear question
- Gather & clean data (usually the biggest job)
- Split into training and testing sets
- Choose & train a model
- Evaluate on unseen test data
- Tune and repeat
- Deploy and predict
A golden rule: always test on data the model hasn't seen, or you're just checking its memory, not its learning.
Concept: Step 2 — gather and clean data — sounds boring but routinely eats 60–80% of a real project's time. Data arrives with typos, missing values, and duplicates. The saying "garbage in, garbage out" is brutally true here: no clever model rescues bad data. Beginners underestimate this step; professionals plan for it.
Hands-On: Try This
Try this: Pick a prediction from your life — will it rain tomorrow? will this email get a reply? Write down the features you'd use and the label you'd predict. You've just framed a machine learning problem the way a practitioner does.
Common Mistakes
Common mistake: Testing a model on the same data it trained on. It'll look brilliant and then fail in the real world — like a student who memorized the practice answers. Always keep a separate, unseen test set.
✅ Checkpoint
- In one line, how does ML differ from traditional programming?
- Which ML type uses labeled data?
- What are features and labels?
Answers: 1) Traditional = rules + data → answers; ML = data + answers → rules. 2) Supervised. 3) Features are the inputs (X); the label is the answer to predict (y).
Key Takeaway: Machine learning flips programming: show data + answers, and the model learns the rules. It comes in supervised (labeled), unsupervised (unlabeled), and reinforcement (reward-driven) flavors. You learn from features (X) to predict a label (y), always testing on unseen data — following the workflow of ask → gather → split → train → evaluate → tune → deploy.
Further Learning
Adapted from Microsoft's AI for Beginners (MIT License). Sketchnote by Tomomi Imura.