← All writing
Fundamentals · 5 min read · 17 Jul 2026

What a Machine Learning Model Actually Is

Strip away the jargon and a model is just a function with knobs, tuned by data. Here is that idea made concrete with one worked example.

Cover image for the article: What a Machine Learning Model Actually Is

Why this question matters

Ask someone to explain what a machine learning model is and you will usually get an answer full of borrowed words: neural networks, training, intelligence. None of that is wrong exactly, but it skips the one idea that actually matters if you want to reason about these systems rather than just use them. A model is a function with adjustable numbers inside it, and training is the process of nudging those numbers so the function's outputs match reality as closely as possible on the data we have.

I think this framing matters because it demystifies the whole field without dumbing it down. Once you see a model as a function with knobs, you can ask the right questions of any system, however large: what does the function look like, what are the knobs, what error are we minimising, and on what data. A transformer with billions of parameters is still, structurally, this same idea scaled up enormously. If the simple version does not make sense to you, the complicated version will not either, it will just be harder to doubt.

So rather than talk in the abstract, I want to build the idea with one small, honest example: predicting house prices from size alone. It is deliberately unglamorous. That is the point. The mechanics you see here are the same mechanics running underneath almost everything else in the field.

The worked example, step by step

Suppose we have a handful of houses with their size in square metres and their sale price in thousands of pounds: a 50 sqm flat sold for 150, a 70 sqm house for 210, a 90 sqm house for 260, and a 120 sqm house for 340. We want a model that, given size, predicts price. The simplest reasonable function is a straight line: price equals a slope multiplied by size, plus an intercept. Written out, that is price = w times size + b. The numbers w and b are the model's parameters, its knobs. Everything else, the shape of the function itself, is called the architecture, and here the architecture is just "a straight line".

Before training, w and b are unknown, maybe initialised to something arbitrary like w = 1 and b = 0. Plug in size 70 and the model predicts a price of 70, which is wildly wrong against the true value of 210. We need a way to measure how wrong the model is across all four examples at once, not just one. That is the job of a loss function. A common choice is squared error: for each house, take the difference between predicted and actual price, square it, then average across all houses. Squaring matters because it punishes big misses more than small ones and keeps everything positive so errors cannot cancel out.

Training is nothing more than searching for the values of w and b that make this average squared error as small as possible. You could imagine trying values by hand: raise w a bit, see if the average error drops, raise it more, see if it drops further, then start adjusting b too. In practice this search is done automatically by an algorithm such as gradient descent, which calculates the direction that reduces the loss fastest and takes a small step that way, repeating this thousands of times. For our four houses, this process would converge to something like w around 2.1 and b around 35, meaning each extra square metre adds roughly two hundred and ten pounds to the predicted price, plus a base of thirty-five thousand pounds. Those two numbers, tuned from data rather than guessed by us, are the entire trained model.

whiteboard with equations

Why the framing scales up

Now stretch this picture. A logistic regression classifier is the same straight-line idea passed through a squashing function so its output lands between zero and one, read as a probability. A decision tree is a function built from a set of if-then splits rather than a slope and intercept, with the splitting thresholds acting as its parameters. A neural network is a stack of these linear-then-squash steps repeated across layers, with millions or billions of weights instead of two. In every case, the questions are identical: what is the function, what are its parameters, what loss are we minimising, and what data are we minimising it on.

This is why the choice of loss function and data matters so much more than people often assume. If our four houses had all come from one wealthy postcode, our neat little w and b would be a fine description of that postcode and a poor description of anywhere else. The model is not learning "the truth about house prices", it is finding parameters that minimise error on exactly the data it was shown. Anything systematically missing or overrepresented in that data becomes a blind spot baked into the numbers. This is also why leakage-aware evaluation, testing the model only on data it genuinely could not have seen during fitting, is not a bureaucratic nicety but the only honest way to know whether those parameters generalise at all.

It is also why a strong, boring baseline is worth respecting. If a straight line predicts house prices almost as well as a complicated ensemble, that tells you the extra complexity is buying you very little, and you should be suspicious of anyone quoting an impressive accuracy figure without comparing it against something simple first. Complexity should earn its place through measured improvement, not assumption.

The practical takeaway

Next time you meet a model, whether it is a spreadsheet regression or a large language model, try translating the marketing language back into this vocabulary. Ask what the function actually computes, how many parameters it has and what they represent, what loss it was trained to minimise, and on what data that minimisation happened. Those four questions will not tell you everything, but they will strip away most of the mystique and leave you with something you can actually reason about and, crucially, actually doubt.

The house price example is trivial on purpose. Two numbers, four data points, one straight line. But the honesty of that smallness is exactly why it is useful: you can see every step, you can check the arithmetic, and you can trust that nothing is hidden. Every larger model you encounter afterwards is doing the same thing, just with more knobs, more data, and a function shape too large to hold in your head at once. Keep the small picture in mind and the large one becomes far less intimidating.

house exterior for sale
← All writing See the project case studies →