People talk about “training a model” as though everyone already knows what a model is. If you have nodded along without being sure, this page clears it up. No prior machine learning knowledge assumed — just the idea of a function from school algebra.
A machine learning model is a function with adjustable numbers
In school you met functions like y = 2x + 3. You put a number in, you get a number out. The 2 and the 3 are fixed: someone chose them for you.
A machine learning model is the same idea with one change: the numbers are not chosen by a person. They start as arbitrary values and get adjusted automatically until the function produces useful answers.
Take predicting a house price from its floor area:
$$\text{price} = w \times \text{area} + b$$

That is the entire trick. A machine learning model is a function whose parameters are learned from data rather than written by hand.
Features and labels: the vocabulary of your data
Two words appear constantly, and mixing them up makes everything else confusing.
Laid out as a table, features are your columns and each house is a row:
| Floor area (m²) | Bedrooms | Age (years) | Price (£) — label |
|---|---|---|---|
| 78 | 2 | 15 | 245,000 |
| 112 | 3 | 8 | 330,000 |
| 65 | 2 | 40 | 198,000 |
This table is a matrix, which is exactly why linear algebra matters — see vectors vs scalars vs matrices. Each row is a vector of features, and the whole dataset is one matrix the model processes in a single operation instead of row by row.
Training: how the numbers get chosen
Training is a loop. It repeats four steps, often thousands of times:
Step 2 uses a loss function — for prices, often mean squared error, which squares each miss so large errors hurt disproportionately. Step 3 is where calculus enters: the derivative says whether nudging a parameter up or down would reduce the error. If you read one calculus page, read the chain rule.
That loop is gradient descent. Run it long enough and the loss stops falling — the parameters have settled, and training is finished.
🧪 The intuition: downhill in fog
The gradient is the slope you feel. The learning rate is how long your stride is. Too short and you take all day; too long and you stride straight over the valley and up the other side.
Inference: using a trained machine learning model
Inference is running the finished model on new data. Training and inference are genuinely different activities, and beginners often blur them:
| Training | Inference | |
|---|---|---|
| Needs labels? | Yes — must know the right answers to measure error | No — the label is what you are asking for |
| Parameters change? | Yes, constantly | No, frozen |
| How often | Once, occasionally repeated | Every time someone uses the product |
| Cost | Expensive, slow | Cheap, fast |
Every time you ask a chatbot a question or your phone unlocks by recognising your face, a machine learning model is running inference. The training happened long ago on someone else’s hardware.
Parameters vs hyperparameters
The words look similar and mean opposite things.
Three machine learning model mistakes beginners make
⚠️ Common pitfalls
- Thinking the model stores the data. It does not. Once trained, a model is just its parameters — a list of numbers. A model trained on a million houses might be a few kilobytes. It has distilled a pattern, not memorised the houses.
- Expecting it to be right. It is a best fit, not a lookup table. It will be wrong on individual cases. The question is never “is it correct” but “is it wrong less often, or less expensively, than the alternative”.
- Judging it on its own training data. The big one — see training data vs test data. A model that memorised its training set looks excellent and fails instantly on anything new.
🔑 Key Takeaways
- A model is a function whose parameters are learned from data, not written by hand.
- Features are inputs, the label is what you predict, parameters are the learned numbers inside.
- Training loops: predict → measure error → find the downhill direction → nudge. That loop is gradient descent.
- Inference is using the frozen model on new data. It needs no labels and changes nothing.
- You set hyperparameters; the algorithm sets parameters.
Further reading
Two references worth bookmarking as you go deeper: Google’s Machine Learning Glossary defines every term you will meet, and the scikit-learn supervised learning guide shows each machine learning model type in working code.
Where to go next
- Supervised vs unsupervised vs reinforcement learning — the three broad families
- Training data vs test data — why you must hold data back
- A worked logistic regression example — the whole loop on a real problem
- Start Here — the full learning path, in order