AI is Closer Than You Think: Machine Learning Part 2

Graph illustrating supervised learning in machine learning, showing a relationship between feature input and price output, with labeled axes for predictions and adjustments, and annotations for training data and patterns found.

Miss Smith’s Straight Line

Miss Smith did a number on me. Back at school the one class I liked was math. I liked the logic and solving puzzles through patterns. My teacher, Miss Smith was awesome. One afternoon she drew a straight line through a cloud of scattered points on graph paper. And something clicked.

“Wait. I can predict the future with this?”

That moment — without knowing it — was my introduction to supervised learning. The idea that you can study past examples, find the pattern underneath, and use it to make confident predictions about something you’ve never seen before.

It’s the same principle that prices houses, filters your inbox, approves your mortgage, and — as I discovered on a campsite in Wales — catches fraud on your bank card in real time.

In Part 2 of my Machine Learning series, I explore how supervised learning actually works. Not the maths. Not the code. The idea — and why it matters.

Because Miss Smith’s straight line didn’t stay on graph paper. It scaled up into some of the most consequential technology running in the world today.


The Cheat Sheet, Revisited

In Part 1, I introduced supervised learning as the approach where machines learn from labelled data — a cheat sheet of examples where the correct answer is already known. Now let’s get under the bonnet.

The best way to understand supervised learning is through a problem everyone has an instinct for: house prices.

Imagine you’re trying to predict what a house will sell for. You have years of sales data — hundreds of houses, each one described by its size, number of bedrooms, age, location, and a dozen other details. And crucially, you know what each one actually sold for.

That dataset is your cheat sheet. The model’s job is to study it — not to memorise it, but to find the pattern underneath. The relationship between what a house is and what it’s worth. Once it has that pattern, you hand it a house it has never seen before, and it makes a prediction.

That’s supervised learning. Past labelled examples, used to make confident predictions about the future.

Miss Smith would recognise it immediately.


Two Ways the Problem Can Look

Supervised learning shows up in two broad flavours, depending on what you’re trying to predict.

The first is regression — predicting a number. House prices are a regression problem. So is forecasting next week’s energy demand, estimating how long before a machine needs maintenance, or predicting a patient’s recovery time. The output is a value on a continuous scale.

The second is classification — predicting a category. Is this email spam or not? Is this transaction fraudulent or legitimate? Is this scan showing signs of disease? The output is a label, a decision, a bucket.

The mechanics underneath both are remarkably similar. In each case, the model studies labelled examples, finds the pattern connecting inputs to outputs, and applies that pattern to new data it hasn’t seen before.

What changes is the shape of the answer.


Learning from Mistakes

Here’s what makes supervised learning work — and what makes it genuinely clever.

The model doesn’t start knowing anything. It begins with a guess — an initial, probably terrible attempt at the pattern. For a house price model, that first guess might be wildly wrong. A three-bedroom terrace in Manchester valued like a penthouse in Chelsea.

But the model knows it’s wrong, because it has the actual sale price right there in the training data. So it adjusts. It tweaks its understanding of which features matter and by how much. Then it guesses again. Checks again. Adjusts again.

Predict. Compare. Adjust. Repeat.

Run that loop across thousands of examples, and something remarkable happens. The model stops guessing and starts understanding. Not because anyone explained the relationship between a house and its value — but because the data did.

This is the same fundamental shift we explored in Part 1. Logic didn’t drive the output. Data did.


When It Goes Wrong

Supervised learning is powerful. It’s also fallible in ways worth understanding.

The most common trap is overfitting — when a model studies its training data so closely it starts memorising quirks rather than learning patterns. It performs brilliantly on examples it’s seen before and poorly on anything new. Like a student who memorises past exam papers word for word, then struggles the moment a question is phrased differently.

The fix is discipline. You always hold back a portion of your data — a test set the model never sees during training — and use it to check whether what the model learned actually generalises.

The deeper trap is bad data. Supervised learning is only as honest as the labels it learns from. If your training data reflects historical biases — in lending decisions, hiring patterns, medical diagnoses — the model will learn those biases and reproduce them at scale. Quietly. Confidently. At speed.

This is why the quality of data isn’t just a technical question. It’s an ethical one. In our [Data and AI series], we explored what it takes to transform raw data into something trustworthy. In supervised learning, that trustworthiness isn’t optional — it’s foundational.


The Straight Line, Scaled Up

Miss Smith’s straight line through a cloud of points is, technically, linear regression — one of the simplest supervised learning models there is. It assumes the relationship between inputs and output can be captured in a weighted sum. Each feature gets a number, and the model learns which numbers make the predictions most accurate.

It sounds simple. In some contexts it’s all you need. In others — where the relationships are non-linear, where the data is images or language or sound — you need something more powerful. Decision trees. Random forests. Gradient boosting. And at the frontier, the neural networks that underpin deep learning.

But here’s what matters: no matter how complex the model, the supervised learning loop doesn’t change.

Past labelled examples. A pattern found in the data. A prediction made about something new.

Miss Smith’s straight line. Just drawn with considerably more dimensions.


Closer Than You Think

Supervised learning isn’t an abstract concept living in a textbook. It priced the house you live in. It filtered the spam you never saw this morning. It flagged the fraudulent transaction on your card — which, as it happens, I know from personal experience it does rather well on a campsite in Wales.

In the next post, I’ll look at unsupervised learning — what happens when there’s no cheat sheet, no labelled answer, and the machine has to find the pattern entirely on its own.

The results, as it turns out, are often the most surprising of all.