Study guide · How machines learn

How machines learn: examples, errors and layers

As of November 23, 2026 · As of November 2026 · about 23 min read

How do you teach a computer to recognize a handwritten seven? Nobody can write down every way people write a seven. This is exactly where machine learning comes in. On this page you follow this one question from the basic terms to the networks that read ZIP codes and bank cheques in the 1990s. Along the way you find out why deep networks were still seen as impractical until about 2010.

Learning from examples instead of rules

In classic programming a person writes every rule. With handwriting, that fails because of the sheer variety. In machine learning the computer gets many examples instead. It derives the rules from the data by itself. Data are therefore essential.

Three terms come up again and again:

  • An example is a single record, such as the image of a digit.
  • Features are the inputs the model reasons from. For an image of a digit, that is for example the brightness of each pixel.
  • A label is the correct answer for an example, that is, the digit that was meant. You can picture it as a small card attached to each image.

The model is a calculation rule that turns the features into a prediction. Its behaviour depends on many adjustable numbers, the parameters. In neural networks they are called weights. Training means setting the parameters so that the model explains the examples well.

There are also settings that you choose yourself before training. They are called hyperparameters. They include the learning rate and the number of hidden layers in a network. The weights and thresholds of the neurons, by contrast, are real parameters, because training sets them from the data.

Three types of learning

Depending on what is known about the data, there are three types of learning.

In supervised learning every training example carries a label. The model learns to infer the label from the features. If it predicts a category, this is called classification. Examples are "spam or not spam" and "which digit". If it predicts a numerical value, this is called regression, for example a house price from size and location, learned from past sales. Both need labels. Networks and decision trees can solve both tasks.

In unsupervised learning there are no labels. The method looks for similarities by itself and forms groups, for example of customers with similar buying habits. A well-known method for this is k-means. James MacQueen coined the name in 1967; the basic idea is older.

In reinforcement learning a program acts, observes the result and receives a reward or a penalty. There is no correct answer per example. The program learns to choose actions that bring many points in the long run. Often the reward only comes much later, for example at the end of a game.

supervisedwith labelsunsupervisedno labelsreinforcementwith reward7733image and labelfind groupsactionrewardpoints for moves
Three types of learning and what is known about the data.

Measuring the error and going downhill

How does a model set its parameters? First it needs a measure of how wrong it is. That is the loss function. It measures how far the model's predictions are from the correct answers and sums this up in a single number. Training tries to make this number as small as possible.

Imagine the error as a landscape of hills and valleys. Each spot stands for one setting of the parameters, and the height stands for the error. Gradient descent works like a ball rolling downhill. The method checks in which direction the error falls most steeply and takes a small step that way. The bottom of the valley stands for the smallest error. A random search, by contrast, would try out new settings blindly.

The size of each step is set by the learning rate. It is a hyperparameter.

  • If the learning rate is too small, training only crawls along.
  • If it is too large, every step jumps across the valley onto the other slope. The error may even grow.

Gradient descent only sees the slope nearby. At the bottom of a small valley the slope is zero, and it stops, even if there is a deeper valley elsewhere. This is called a local minimum. Smaller steps do not help here; they stay in the valley all the more. Whether you end up in the deepest valley therefore also depends on the starting point.

1 Compute theprediction2 Measurethe errorloss function3 Pass the errorbackwardsbackpropagation4 Adjust weightsby one stepgradient descentnext example
The training loop of a neural network.

Read on

You can read the introduction and the first 3 of 11 sections here for free. There are two ways to get the whole learning page:

Free with a confirmed e-mail address

Sign up with your e-mail address and confirm it. You can then unlock the learning pages of one set of your choice completely, once, in the browser or in the app.

Unlock for free

Buy the course

The course includes all its questions and the whole learning page.

View the course
These 8 sections are still missing
  1. Neural networks: layers and activation
  2. Backpropagation: passing the error backwards
  3. Memorizing or understanding?
  4. Convolutional networks read digits
  5. Other paths: support vector machines, trees and forests
  6. Learning by playing: TD-Gammon
  7. Why deep networks stalled for so long
  8. Key points

Qwissit is also available as an app for iPhone and Android:

As of: November 23, 2026 (As of November 2026)

Sources:

  • Rumelhart, Hinton, Williams, Learning representations by back-propagating errors, Nature 323, October 1986
  • LeCun and others, Backpropagation Applied to Handwritten Zip Code Recognition, Neural Computation 1, 1989
  • LeCun, Bottou, Bengio, Haffner, Gradient-Based Learning Applied to Document Recognition, Proceedings of the IEEE, 1998
  • Hochreiter, Untersuchungen zu dynamischen neuronalen Netzen, diploma thesis, TU Munich, 1991; Hochreiter and Schmidhuber, Long Short-Term Memory, Neural Computation 9, 1997; Gers, Schmidhuber, Cummins, Learning to Forget, Neural Computation 12, 2000
  • Cortes and Vapnik, Support-Vector Networks, Machine Learning 20, 1995; Breiman, Random Forests, Machine Learning 45, 2001
  • Tesauro, Temporal Difference Learning and TD-Gammon, Communications of the ACM, 1995; IBM History, The games that helped AI evolve
  • Hinton, Osindero, Teh, A Fast Learning Algorithm for Deep Belief Nets, Neural Computation 18, 2006; Hinton and Salakhutdinov, Science 313, 2006
  • Raina, Madhavan, Ng, Large-scale Deep Unsupervised Learning using Graphics Processors, ICML 2009

This study guide was written with AI and compared with the sources.

Certifications & exams

Which exam comes next?

You can already practise for 60 exams, and 7 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications