Machine learning
Machine learning is the part of AI in which a program improves at a task through experience — data — instead of following rules written in advance. Supervised learning learns from labelled examples, unsupervised learning finds structure in unlabelled data, and reinforcement learning learns which actions earn reward by trial and error. The real test of a learned model is not how well it fits its training data but how well it performs on new data it has never seen.
Generalisation is the goal
Machine learning differs from pure optimisation because the quantity we care about — error on future data — cannot be optimised directly. We minimise an empirical loss on a training sample and rely on the training and test data being drawn from the same distribution.
- Underfitting: model capacity too low, so training error is high.
- Overfitting: capacity too high relative to the data, so the train–test gap is large.
- Hyperparameters (such as model size) are tuned on a validation set, never on the test set, so that the test estimate stays unbiased.
The supervised/unsupervised split is not exhaustive: Sutton and Barto argue reinforcement learning, which learns from evaluative reward rather than instructive labels, is a third paradigm.
Full explanation — the complete reference version every reading depth is based on
Learning, defined
A widely used definition, from Tom Mitchell (1997) and quoted in the standard textbook Deep Learning, says a program learns from experience E with respect to tasks T and a performance measure P if its performance at T, as measured by P, improves with E. A spam filter (task: sort email; measure: percentage sorted correctly; experience: emails people have labelled) is a classic example.
Three ways to learn
- Supervised learning: every training example comes with a label giving the correct answer (this photo shows a cat; this house sold for £250,000). The model learns to map inputs to labels.
- Unsupervised learning: there are no labels; the aim is to find structure hidden in the data, such as groups of similar customers.
- Reinforcement learning: nobody gives the right answer; the learner tries actions and discovers which ones earn the most reward over time.
Many different model types can be trained this way. A decision tree, for example, asks a sequence of questions about the input: each question splits the examples into smaller groups, and each final group (a leaf) gives one answer. In machine learning the questions are chosen by an algorithm from the training examples rather than written by hand — the 'Build a Tiny Paper Decision Tree' activity lets you do the same thing with cards.
Training error, test error and generalisation
A model is fitted to a training set, but it is judged on a separate test set that it never saw during training, because what matters is how it will perform when deployed. Two things must go right: the training error must be small, and the gap between training error and test error must be small. If the model cannot even fit the training data, it is underfitting; if it fits the training data far better than new data, it is overfitting — it has learned quirks of its examples rather than the underlying pattern.
Mean squared error: the average of the squared differences between the model's predictions ŷ and the true values y over m examples.
Worked example: choosing the better line
Suppose the data points are (1, 2), (2, 4) and (3, 6) and we try the model y = wx. With w = 1.5 the predictions are 1.5, 3 and 4.5, so the errors are 0.5, 1 and 1.5 and the mean squared error is (0.25 + 1 + 2.25) / 3 ≈ 1.17. With w = 2 every prediction is exact and the error is 0. 'Learning' here means searching for the value of w that makes the error smallest — the job gradient descent does for models with millions of numbers instead of one.
A little history
The phrase 'machine learning' appears in the title of Arthur Samuel's 1959 paper about a program that played draughts (checkers). The field grew into today's dominant way of building AI because many useful tasks — recognising speech or faces — are easy for people to do but very hard to write down as rules. Hardware mattered too: the deep-learning textbook by Goodfellow and colleagues names the growth in model size, made possible by faster CPUs, general-purpose GPUs and better software for distributed computing, as one of the most important trends in deep learning's history.
Ask ScienceVerse
Still curious about Machine learning? Ask a question, get hints, take a short lesson or try a challenge. The tutor answers only from this concept's approved sources, and says so when it has none.
Ask the tutor about this concept on the full tutor page.
Connections
Guided learning path
See everything to learn before this, in order, with your progress:
Leads to
This concept is a building block for:
Related concepts
- Reinforcement learning — Has special case
- CPU — Related to
Try the experiment
Put this concept into practice with a hands-on activity (each shows its supervision requirement first):
Check your understanding
Take a quick check of two to five questions, with an explanation for every answer:
See the neighbourhood of Machine learning in the Knowledge Galaxy
Sources and methodology
- A widely used definition (Mitchell, 1997) says a computer program learns from experience E with respect to a class of tasks T and a performance measure P if its performance at tasks in T, as measured by P, improves with experience E. (awaiting scientific review)
- Supervised learning is learning from a training set of labelled examples, where each example's label specifies the correct response the system should give in that situation. (awaiting scientific review)
- Unsupervised learning is typically about finding structure hidden in collections of unlabelled data. (awaiting scientific review)
- Sutton and Barto treat reinforcement learning as a third machine-learning paradigm alongside supervised and unsupervised learning, in which the learner is not told which actions to take but must discover which actions yield the most reward by trying them. (awaiting scientific review)
- Machine-learning systems are evaluated on a test set kept separate from the training data, because what matters is how well a system performs on data it has not seen before. (awaiting scientific review)
- How well a machine-learning algorithm performs depends on making the training error small and making the gap between training and test error small; failing the first is called underfitting and failing the second is called overfitting. (awaiting scientific review)
- The phrase 'machine learning' appears in the title of Arthur Samuel's 1959 paper 'Some Studies in Machine Learning Using the Game of Checkers', published in the IBM Journal of Research and Development. (awaiting scientific review)
- Some Studies in Machine Learning Using the Game of Checkers — Peer-reviewed paper
- A decision tree is a learning algorithm in which each node is associated with a region of the input space, internal nodes split that region into sub-regions for their children, and each leaf usually maps every point in its region to the same output. (awaiting scientific review)
- Goodfellow and colleagues describe the increase in model size over time — made possible by faster CPUs, general-purpose GPUs, faster network connectivity and better software for distributed computing — as one of the most important trends in the history of deep learning. (awaiting scientific review)
- Worked calculation (author's own, using the mean squared error defined in Goodfellow et al., chapter 5): for the data points (1, 2), (2, 4) and (3, 6), the model y = 1.5x has mean squared error (0.25 + 1 + 2.25) / 3 ≈ 1.17, while y = 2x has mean squared error 0. (awaiting scientific review)
Claims marked “awaiting scientific review” cite the sources listed but have not yet been signed off by a scientific reviewer.
Content status: published 1 October 2026.
- Scientific review: this version has not yet been signed off by a scientific reviewer.
- The Advanced explanation has not yet been reviewed for age suitability.