Black October, explainedAppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

Machine learning

Also called ML

Machine learning is a way of building software where the computer works out its own rules from examples, instead of a person writing every rule.

The basicsEveryday

In plain words

Normal software is a list of instructions. A programmer decides the rules and the computer follows them. That works when the rules are clear, like adding GST to a bill.

But try writing rules for spotting a spam message, or recognising your friend's face. There are too many cases and exceptions. Nobody can list them all.

Machine learning flips the job. Instead of rules, we give the computer lots of examples, often with the right answers attached: these emails are spam, these are not. A learning method then adjusts a model until its guesses match the answers. What comes out is a set of rules the computer found itself, stored as numbers.

The model can then handle new cases it has never seen. That step is called inference.

Everyday example

Learning to pick ripe mangoes

Nobody hands a child a rulebook for ripe mangoes. A grandparent at the market just says "this one, not that one", again and again. After enough mangoes the child can judge a new one by colour, smell and softness. Machine learning works the same way: many labelled examples in, a judging skill out, which then works on mangoes it has never seen.

Where the example breaks: The child also understands what a mango is and why ripeness matters. A model only finds patterns in the numbers it was given, so it can latch onto the wrong clue, such as the colour of the basket.

Go deeper

How it actually works

Most machine learning follows the same recipe: data, a model with adjustable numbers, and a way to measure and reduce mistakes.

  1. Collect examples

    The training data is a large set of examples. In supervised learning each one comes with the right answer, called a label. In unsupervised learning there are no labels and the model looks for groups or structure on its own.

  2. Start with a model full of dials

    A model is a mathematical function with many adjustable numbers called parameters. At the start they are random, so its guesses are poor.

  3. Measure the mistakes

    Each guess is compared with the right answer. A loss function turns the gap into one number: how wrong the model was.

  4. Nudge and repeat

    An algorithm such as gradient descent changes every parameter slightly in the direction that lowers the loss. Repeating this over many examples is training.

  5. Test on new data

    Finally the model is checked on examples it never saw. If it does well only on its training examples, it has memorised instead of learned, which is called overfitting.

Early use of the name
1959, in the title of Arthur Samuel's paper on a checkers program at IBM
Samuel's result
The program learned to play better than the person who wrote it
Main kinds
Supervised, unsupervised and reinforcement learning
Everyday uses
Spam filters, recommendations, fraud checks, voice typing, traffic estimates

Questions people ask

What is the difference between AI and machine learning?

AI is the goal: computers doing tasks that seem to need intelligence. Machine learning is the main method used today to reach it, by learning from examples. All machine learning is AI, but some AI, like hand-written rule systems, is not machine learning.

What is the difference between machine learning and deep learning?

Deep learning is a type of machine learning that uses neural networks with many layers. It needs more data and computing power but learns its own features, which is why it handles photos, speech and language so well.

Who coined the term machine learning?

Arthur Samuel of IBM used it in the title of his 1959 paper about a checkers program that learned to beat its author. The popular line about computers learning "without being explicitly programmed" is often credited to him, but it does not appear in that paper.

Does a machine learning model keep learning after it is built?

Usually not. Most models are trained once, then frozen and used. Your chats do not change the model on the spot. Companies may collect data and train a new version later, which is a separate step.

Do you need maths to understand machine learning?

Not to understand the idea: examples in, adjustable numbers, mistakes measured and reduced. Building models yourself uses some algebra, statistics and calculus, though software libraries handle most of it.

Further reading