What Is Machine Learning?
We've located Machine Learning on the map. Now we step inside it. What does it actually mean for a program to "learn," what kinds of learning exist, and what is the repeatable workflow that every algorithm in the rest of this course plugs into?
Lessons 1–3 were the map. This is the machine. Every remaining lesson — Linear Regression, k-NN, Decision Trees, k-Means, all of it — is a specific instance of the two ideas you'll meet here: a type of learning (what experience the model gets) and the ML workflow (the pipeline from raw data to a trusted model). Get this lesson solid and every later algorithm becomes "fill in the blanks of a template you already know." By the end you'll be able to take any new problem and say what type of ML it is and what the end-to-end steps to solve it would be.
Abstractions blur; a running example keeps us honest. Throughout this lesson we'll use one small, concrete dataset — predicting a house's sale price from a few of its properties — and revisit it at every stage. Here are five rows of it:
| Size (m²) | Bedrooms | Age (yrs) | Neighborhood | Sale price (€) |
|---|---|---|---|---|
| 60 | 2 | 30 | East | 180,000 |
| 85 | 3 | 12 | Center | 295,000 |
| 120 | 4 | 5 | Center | 430,000 |
| 45 | 1 | 40 | West | 132,000 |
| 100 | 3 | 8 | East | 350,000 |
Keep this table in mind. We'll point at its columns to define every term below.
What this lesson delivers
- A precise definition of "learning" for a machine — and how it differs from ordinary programming.
- The three (really four) types of learning, with the question each one answers and a worked example of each.
- The supervised split — regression vs classification — that organizes Parts III–IV.
- The core vocabulary — features, labels, model, parameters, training — grounded in the house dataset.
- The end-to-end ML workflow, walked step by step on a real problem.
1 · What "learning" means for a machine
The word "learning" invites mysticism, so let's kill the mysticism immediately. In Lesson 1 we met the definition that strips it bare — worth restating because it is the spine of everything below:
No consciousness, no understanding — just measurable improvement on a task as it sees more data. "Learning" is fitting a program to data so that a number goes up (or an error goes down).
Mitchell's definition isn't decoration — you can instantiate it right now:
- T (task) = predict a house's sale price from its size, bedrooms, age, and neighborhood.
- P (performance) = average euro error of the predictions on houses the model has never seen.
- E (experience) = a table of past sales, like the five rows above — but with thousands of rows.
If the average error shrinks as we feed it more past sales, the program is learning. That's the whole claim, made measurable.
Contrast the two paradigms directly, because the inversion is the entire point of the field:
| Classical programming | Machine Learning | |
|---|---|---|
| You write | The rules (the algorithm) | A learning procedure + example data |
| Inputs | Data + rules | Data + desired answers |
| Output | Answers | The rules (a trained model) |
| When to use | You can state the rules | You can't state the rules, but you have examples |
The classical approach would have you write the pricing formula yourself: maybe price = 3000 × size + 10000 × bedrooms − 500 × age. But where did those coefficients come from? You'd be guessing. The ML approach refuses to guess: you hand it the table of past sales (inputs and the prices) and it discovers the coefficients that best reproduce them. In classical programming, rules + data → answers. In ML you flip two boxes: data + answers → rules. Training is program synthesis by numerical optimization.
That phrase — generalizes to new inputs — is the whole game, and it deserves its own callout because it's the difference between learning and memorizing.
Any program can memorize a lookup table of the training examples and score perfectly on them. Example: a model that simply stores "60 m², East → €180,000" answers perfectly for that exact house and is useless the moment a 62 m² house in the East shows up — a value it has never seen. That's memorizing, not learning. The goal of ML is generalization: performing well on data it has never seen. Everything hard about the field (overfitting, validation, regularization — Parts III and V) exists to serve this one goal. Keep asking, of every technique: "how does this help the model generalize rather than memorize?"
2 · The vocabulary you'll use in every remaining lesson
Before the types and the workflow, lock down five words. Every algorithm reuses them, so we define them once — and point each one at a column of the house table.
Suppose training landed on the model price = 3,100·size + 8,000·bedrooms − 600·age + 5,000. Take the third house in our table (120 m², 4 bedrooms, 5 years old):
The actual price was €430,000, so this prediction is off by €24,000. That gap — the error — is exactly what training tries to make small across all rows at once. Every algorithm in this course is, at heart, a smarter way of shrinking that gap.
Strip away the specifics and every supervised algorithm is doing this:
The models differ only in the shape of f and how we search for its parameters. That's it. That's the course.
3 · The types of learning
Machine Learning problems divide by what kind of experience the system learns from — the E in Mitchell's triple. There are three canonical types (plus one important in-between), and each answers a different question. We'll give each a concrete example built from the same real-estate world, so the differences are unmistakable.
Do you have labeled answers to learn from? Yes → supervised. No, just raw data to explore → unsupervised. No labels, but an environment that pays out rewards for actions → reinforcement. The single most common beginner mistake is trying to force an unsupervised problem (no labels) into a supervised algorithm. Identify the type first; it determines every downstream choice.
The supervised split: regression vs classification
Because supervised learning is most of the course, it gets its own subdivision — decided entirely by what kind of thing the label is.
| Regression | Classification | |
|---|---|---|
| Label is… | a continuous number | a category / class |
| Answers… | "how much / how many?" | "which one / is it?" |
| House-data version | predict the sale price (€430,000) | predict "will it sell within 30 days?" (yes / no) |
| Other examples | temperature, demand, salary | spam/not, disease type, digit 0–9 |
| Course home | Part III (Lessons 10–13) | Part IV (Lessons 14–18) |
Example: "predict the number of stars (1–5) a review gets." It looks numeric, but the answer is one of five discrete categories, so it's usually treated as classification (or its cousin, ordinal). Contrast: "predict a house's price" is genuinely continuous — €406,001 and €406,002 are both valid and meaningfully close — so it's regression. Always ask what the output is, and whether the distances between output values are meaningful.
4 · The Machine Learning workflow
Here is the payoff of the lesson: the repeatable pipeline that turns a business problem into a trustworthy model. Every project follows this loop, and every remaining lesson is a deep dive into one stage. We'll state each step and walk it on a concrete brief:
A real-estate agency wants a tool that suggests a listing price for a new house from its size, bedrooms, age, and neighborhood. They have a spreadsheet of 5,000 past sales. Let's walk the eight steps on exactly this.
The numbering suggests a straight march, but real ML is a cycle. In our brief, the disappointing €31,000 error at step 6 pushed us back to step 3 (better features) and step 5 (a different model). Drift in production (step 8) will push us back to step 2. Notice how few of the eight steps are "train the model." The algorithm is one box; the discipline around it is the other seven — and that discipline is what separates a trustworthy tool from a demo.
Parts II (concepts & tools) and the algorithm Parts III/IV/VI/VII all deepen steps 3–5 (prepare, choose, train). Part V (evaluation) is steps 4, 6, 7. Part VIII (practical ML & capstone) walks the entire loop end-to-end — much like the house brief above. You now have the skeleton every later lesson hangs on.
The shape of "training," in eight lines
No real algorithm yet — but so the word "training" isn't abstract, here is the pattern almost every supervised learner in this course will follow. Read it as the machine repeatedly re-pricing our 4,000 houses and nudging its weights toward the true prices:
# The universal training loop, in spirit
model = init_parameters() # start with a guess, e.g. all weights = 0
for step in range(num_steps):
predictions = model.predict(X_train) # its price for every house right now
error = loss(predictions, y_train) # avg gap vs true prices (Lesson 6)
gradient = d_loss_d_parameters(error) # which way reduces the gap (Lesson 7)
model = update(model, gradient) # nudge each weight that way
# repeat until the error stops improving → the model has "learned"
Predict, measure error, adjust, repeat. That is training. Concretely: step 0 predicts €0 for every house (error huge); after many iterations w₁ has climbed toward ~€3,100/m² and the error has fallen to its minimum. Loss functions (Lesson 6) define "error," and optimization (Lesson 7) defines "which way to adjust" — which is exactly why those two lessons come next.
5 · Limitations — what to keep honest about
- ML needs the right data, not just data. If our spreadsheet lacked location entirely, no algorithm could recover that two identical flats differ by €150,000 across town. "Can this even be predicted from what I have?" is the first question, not the last.
- Correlation, not comprehension. If, in our data, expensive houses happen to have blue doors, the model will learn "blue door → high price." It has no notion of cause unless you build it in.
- Good training score ≠ good model. A model can hit €0 error on the 4,000 training houses by memorizing them, yet post €80,000 error on the held-out 1,000. Until you measure on unseen data (step 4/6), you know nothing about generalization.
- The type dictates everything. Misframe "will it sell in 30 days?" (classification) as regression and you'll pick the wrong algorithms, metrics, and splits. Frame first (step 1).
How this connects to the next lesson
This closes Part I: you have the map (Lessons 1–3) and now the machine's blueprint — types of learning and the eight-step workflow, walked on a real brief. Part II zooms into the conceptual core those steps assume. Lesson 5 — Model, Parameters, and Error takes the vocabulary you just met — the house model, its weights, the €24,000 gap — and makes it rigorous, so that when Lesson 6 defines loss and Lesson 7 defines optimization, the universal training loop above turns from pseudocode into something you can actually build. The rest of the course is filling in that loop, one algorithm at a time.
Exercises & reflection
Still calibration, not code — but now the answers should feel like the start of real ML thinking.
Classify each as supervised (regression or classification), unsupervised, or reinforcement:
- Predict tomorrow's electricity demand in megawatts.
- Group a store's customers into segments with no predefined categories.
- Decide if a transaction is fraudulent, given past labeled transactions.
- Teach a robot to walk by rewarding forward motion.
Show discussion
(1) Supervised — regression (continuous number). (2) Unsupervised — clustering, no labels given. (3) Supervised — classification (fraud/not, with labels). (4) Reinforcement — reward from acting in an environment. If you paused on (1) vs (3): the deciding factor is the label type — a number vs a category.
Using the model price = 3,100·size + 8,000·bedrooms − 600·age + 5,000, compute the prediction and the error for the second house in our table (85 m², 3 bedrooms, 12 years old, actual €295,000).
Show solution
ŷ = 3,100·85 + 8,000·3 − 600·12 + 5,000 = 263,500 + 24,000 − 7,200 + 5,000 = €285,300. Actual is €295,000, so the error is €9,700 (the model under-predicts). Notice it's a smaller gap than the €24,000 we saw on house 3 — training minimizes these gaps across all rows at once, so no single house is perfect.
Pick a supervised problem (e.g. "predict which trial users will convert to paid"). Write one concrete sentence for each of the eight workflow steps as they'd apply — mirroring the house brief. Where would you most fear data leakage, and which step guards against it?
Explain, in two sentences, why our house model scoring €0 error on the 4,000 training houses might be worse than one scoring €20,000 on them. Use the words "memorize" and "unseen." (You've just previewed overfitting — Lesson 13.)
Machine Learning is program synthesis by optimization: instead of writing the pricing rule, you supply past sales (features and prices) and let training fit a model's parameters so that f(X) ≈ y — and, crucially, still holds on houses it has never seen (generalization). Problems divide by the experience available — supervised (labeled prices), unsupervised (prices removed, find groups), reinforcement (rewarded actions) — and supervised further splits into regression (predict the price) and classification (predict "sells in 30 days?"). Every project runs the same eight-step loop from framing to monitoring, of which "train the model" is a single step; the other seven are the discipline that makes the model trustworthy. That loop is the scaffold on which the entire rest of this course is built.