---
kind: concept
slug: machine-learning
title: Machine learning
summary: >-
  Getting a computer to learn patterns from example data instead of following rules written by hand. Covers the three learning types, the four aspects of building a model, how models are assessed, and the practical risks: bias and drift in data, explainability and resource limits. Two sources: a conceptual review and an open textbook with runnable code. Neither reports experiments of its own.
tags: [fundamentals, model-assessment]
papers: ["2104.05314", "2106.11342"]
related: [deep-learning, transfer-learning, explainable-ai, interpretable-machine-learning, support-vector-machine, data-poisoning, multi-layer-perceptron]
status: draft
updated_at: 2026-10-19
---

## Overview

Machine learning (ML) is the part of artificial intelligence in which a system
learns from training data specific to the problem, instead of following rules
a person wrote [arxiv:2104.05314 p. 3]. Artificial intelligence is the wider
goal: machines that match or beat human decision-making on complex tasks
[arxiv:2104.05314 p. 3]. [Deep learning](/concepts/deep-learning) is a further
subset, built on neural networks with many layers [arxiv:2104.05314 p. 3].

The review's motivation is data. Electronic markets produce much unstructured
data, such as time series, images and text. Finding patterns in it by hand
would exceed human capacity, so the authors argue for automated model building
[arxiv:2104.05314 p. 4].

This page rests on two sources. The first is a conceptual review with no
equations, algorithms, benchmarks or code [arxiv:2104.05314 p. 1]. It gives
vocabulary and a list of practical risks. The second is an open textbook that
teaches the field from linear algebra and probability onward, with runnable
code. It introduces no new method of its own [arxiv:2106.11342 §1]. It supplies
the methods and worked examples that the review leaves out. The two are covered
under Variants and in the sections below.

## Variants

### Types of learning

The review splits ML into three types, chosen by the problem and the data
[arxiv:2104.05314 tab. 1] [arxiv:2104.05314 p. 3]:

- **Supervised learning.** The training inputs come with labelled target
  values. The goal is to predict a number (regression) or a class
  (classification).
- **Unsupervised learning.** The inputs have no labels. The goal is to find
  structure: groups (clustering) or a compact representation.
- **Reinforcement learning.** The learner gets a goal, allowed actions, constraints
  and a reward signal. It learns by trial and error to maximise reward.

Card: [Machine learning and deep learning](/papers/2104.05314).

The textbook covers two of these types with methods and code. Its
supervised chapters start from linear networks for regression and
classification [arxiv:2106.11342 §3–§4]. Its reinforcement learning chapter
starts from Markov decision processes [arxiv:2106.11342 §17]. Card:
[Dive into Deep Learning](/papers/2106.11342).

### Ways to build a model

The review compares three paradigms, using the four aspects of model building
described below [arxiv:2104.05314 fig. 2] [arxiv:2104.05314 p. 4–5]:

- **Explicit programming.** A person writes the rules. There is no learning
  step [arxiv:2104.05314 p. 4].
- **Shallow machine learning.** A person designs the features, and a learning
  algorithm fits the model on them. The review names decision trees and
  [support vector machines](/concepts/support-vector-machine) as examples
  [arxiv:2104.05314 p. 5].
- **Deep learning.** Feature learning and model building happen in one
  pipeline [arxiv:2104.05314 p. 5]. See [deep learning](/concepts/deep-learning).

The review says the boundary between shallow and deep is not exact
[arxiv:2104.05314 p. 4]. The textbook treats the deep side in more depth:
multilayer perceptrons come first [arxiv:2106.11342 §5], followed by
convolutional networks [arxiv:2106.11342 §7] and attention with transformers
[arxiv:2106.11342 §11].

## When to use which

The review gives qualitative guidance only. The textbook gives no selection
rules, so its row below only points to where the methods are taught. Each row
states what the cited source says.

| Situation | Use | Why |
|---|---|---|
| Labelled examples; the target is a number or a class | Supervised learning | Labels define the target [arxiv:2104.05314 tab. 1] |
| No labels; you need groups or a compact representation | Unsupervised learning | [arxiv:2104.05314 tab. 1] |
| A goal reached through a sequence of actions, with a reward signal | Reinforcement learning | Learns by trial and error to maximise reward [arxiv:2104.05314 tab. 1]. The textbook starts this from Markov decision processes [arxiv:2106.11342 §17] |
| Low-dimensional data with little training data | Shallow machine learning | The review reports shallow models can do better here, citing other work [arxiv:2104.05314 p. 1] [arxiv:2104.05314 p. 4] |
| Unstructured data: images, text, time series, signals | Deep learning, with an architecture matched to the data | Manual feature design is slow, expertise-heavy and inflexible [arxiv:2104.05314 p. 5] |
| Any model choice | Compare accuracy with memory, speed and cost together | A 99.9% accurate model that is too slow for a time-critical task is not useful [arxiv:2104.05314 p. 7] |
| High-stakes decisions that must be explained | An interpretable model or an explanation method; see [explainable AI](/concepts/explainable-ai) | The review recommends this for high-stakes systems and does not test the choice [arxiv:2104.05314 p. 8] |
| Learning the methods from first principles, with runnable code beside the theory | The [Dive into Deep Learning](/papers/2106.11342) textbook | The book pairs its text with notebooks and starts from linear algebra and probability [arxiv:2106.11342 §1] [arxiv:2106.11342 §2] |

## Model-building process

The review describes four aspects of building an analytical model
[arxiv:2104.05314 p. 4] [arxiv:2104.05314 fig. 2]:

1. **Data input.** Collect the raw data, which may be structured or not.
2. **Feature extraction.** Derive properties from the raw input that keep the
   information needed to separate classes. Manual design is one option; deep
   networks learn features hierarchically, from simple parts to complex ones
   [arxiv:2104.05314 p. 4–5].
3. **Model building.** A learning algorithm finds the patterns that matter for
   the task. A decision tree splits the data into more homogeneous partitions.
   A support vector machine finds a separating hyperplane, often after mapping
   the data into a higher-dimensional space [arxiv:2104.05314 p. 5].
4. **Model assessment.** Judge the model on performance, computational
   resources and interpretability [arxiv:2104.05314 p. 5].

## Assessment

- **Out-of-sample performance.** Use k-fold cross-validation, which guards
  against overfitting and gives out-of-sample estimates [arxiv:2104.05314 p. 5].
  The textbook covers generalization alongside dropout in its multilayer
  perceptron chapter [arxiv:2106.11342 §5].
- **Metrics.** For classification the review names accuracy, recall, precision
  and F1. For regression it names RMSE and MAPE [arxiv:2104.05314 p. 5–6].
- **Unequal error costs.** Where mistakes cost different amounts, as in fraud
  detection, the review suggests cost-sensitive measures such as the average
  cost per prediction [arxiv:2104.05314 p. 6].
- **Cost.** Weigh model complexity, such as the number of trainable parameters,
  and computational cost, such as memory and inference time [arxiv:2104.05314
  p. 6–7]. The textbook gives computational performance its own chapter, on
  compilers, asynchrony, hardware, multi-GPU training and parameter servers
  [arxiv:2106.11342 §13].

## Risks in practice

The review lists four challenges for intelligent systems [arxiv:2104.05314 p. 7–9]:

- **The triangle of architecture, hyperparameters and training data.** These
  trade off accuracy, memory, speed and cost [arxiv:2104.05314 p. 7].
- **Bias and drift.** Data can carry bias, and its distribution can change over
  time. The review calls concept drift sudden, gradual or recurring, and hard to
  detect. It names manual checks and periodic retraining as current practice,
  and lists data poisoning as a threat [arxiv:2104.05314 p. 7–8]. See
  [data poisoning](/concepts/data-poisoning).
- **Unpredictability and explainability.** Models can behave in ways that are
  hard to predict, so the review asks for explainability [arxiv:2104.05314 p. 8].
  See [interpretable machine learning](/concepts/interpretable-machine-learning).
- **Resource limits and transfer learning.** Pre-trained models can save
  resources, but the review names backdoors in them as a risk
  [arxiv:2104.05314 p. 8–9]. See [transfer learning](/concepts/transfer-learning).

## Implementation sketch

The review defines no procedure. The sketch restates its four aspects and its
assessment step. It is not an algorithm from the paper. The textbook's base
trainer follows the same shape: a training pass that updates the model, then a
validation pass with gradients turned off [code: d2l/torch.py#L277-L311]. The
book's chapters implement the standard methods they cover; they do not define a
single procedure.

```pseudocode
# Build and assess a model  [arxiv:2104.05314 p. 4–7]
# Input:  raw data, labels for supervised tasks
# Output: a fitted model and its assessment

def build_model(raw_data, labels):
    # Data input and feature extraction  [p. 4–5]
    features = extract_features(raw_data)
    # Model building: a learning algorithm fits the features  [p. 5]
    model = fit_learning_algorithm(features, labels)
    return model

def assess(model, data, labels, k):
    # k-fold cross-validation guards against overfitting  [p. 5]
    scores = k_fold_scores(model, data, labels, k)
    # Report performance, cost and interpretability together  [p. 5–7]
    return {
        "metrics": scores,                    # e.g. F1, RMSE  [p. 5–6]
        "memory_and_inference_time": cost(model),
        "interpretability": explain_notes(model),
    }
```

## Contradictions

None known. The two sources answer different questions: the review gives
vocabulary and risks, and the textbook gives methods and code. Inside the
review, interpretability is stated loosely. It calls some shallow models
inherently interpretable and most advanced models opaque unless explained, yet
it also says shallow models can be more interpretable than deep networks
[arxiv:2104.05314 p. 4]. None of these claims is measured.

## Papers

- [Machine learning and deep learning](/papers/2104.05314): a conceptual review
  that defines AI, machine learning and deep learning, contrasts three modelling
  paradigms, and lists deployment challenges. No experiments.
- [Dive into Deep Learning](/papers/2106.11342): an open textbook that pairs
  text, maths and runnable notebooks, from linear networks through transformers
  to reinforcement learning. It introduces no new algorithm, and its book
  benchmarks are not stated.
