Reference

Glossary

126 terms, each in a sentence or two, with the chapter that introduces it.

A

Activation function

A simple function applied to each neuron's output before it is passed on. It is what lets a network represent curves and not only straight lines.

Chapter 15: Layers and Activations

Adam

An optimizer that combines momentum with a per-weight adaptive step size. It is the usual default for training neural networks.

Chapter 18: Optimizers · See also momentum, adaptive learning rate

Adaptive learning rate

A separate step size for every weight, set automatically from the size of that weight's recent gradients.

Chapter 18: Optimizers

AUC

Area under the ROC curve. It is the chance that the model scores a random yes above a random no. 1 is perfect, 0.5 is guessing.

Chapter 7: Measuring Classifiers · See also roc curve

B

Backpropagation

The method for finding how every weight in a network affects the loss. It applies the chain rule backward from the loss, one layer at a time.

Chapter 17: Backpropagation · See also chain rule

Backward pass

Sending the gradient of the loss back through the network, from the last layer to the first, so that each layer can work out the gradients of its own weights.

Chapter 17: Backpropagation · See also forward pass

Batch

A group of examples passed through a model together, as the rows of one matrix.

Chapter 14: A Single Neuron

Batch size

The number of examples used for each training step.

Chapter 21: A Real Dataset · See also mini-batch

Bayes' rule

The rule for updating a belief when evidence arrives. It combines how likely something was beforehand with how well the evidence fits it.

Chapter 9: Naive Bayes

Bias

The prediction when the input is zero, where the line crosses the vertical axis. Also called the intercept.

Chapter 2: Linear Regression

Bias (of a model)

Error from the model being too rigid to match the real pattern, however much data it sees. Not the same thing as the bias term b of a line.

Chapter 4: Generalization · See also variance (of a model)

Binary cross-entropy

The cross-entropy loss for a yes/no answer. It is the log loss from logistic regression under another name.

Chapter 20: One Network, Many Jobs · See also log loss

C

Chain rule

When one calculation feeds into another, the overall rate of change is the product of the rates of each step.

Toolkit 0.2: Derivatives and Gradients

Classification

Predicting a category, such as pass or fail.

Chapter 1: What Is Learning? · See also regression

Closed-form solution

An answer you can compute directly with a formula, with no trial and error.

Chapter 2: Linear Regression

Conditional probability

The probability of one thing given that another is known to be true, such as the chance a message is spam given that it contains "free".

Toolkit 0.3: Probability

Confusion matrix

A two-by-two table that counts predictions by what was predicted and what was true. It shows which kinds of mistake a model makes.

Chapter 7: Measuring Classifiers · See also precision, recall

Converge

To settle down. A run has converged when further steps no longer change the parameters or the loss noticeably.

Chapter 3: Gradient Descent · See also diverge

Convex

Shaped like a single bowl. A convex loss has one lowest point and no other dips to get stuck in.

Chapter 3: Gradient Descent

Cross-entropy

The usual loss for classification. It is minus the logarithm of the probability the model gave to the correct class.

Chapter 16: Scoring a Classifier · See also log loss

Cross-validation

Splitting the data into several parts and taking turns to hold each part out, so every example is used for both fitting and checking.

Chapter 4: Generalization · See also validation set

Curse of dimensionality

The way data becomes sparse as features are added. With many features every point is far from every other, and "nearest" stops meaning much.

Chapter 8: Nearest Neighbours

D

Data leakage

When information from the validation or test examples slips into training. It makes results look better than they will be in real use.

Chapter 4: Generalization · See also test set

Dataset

A collection of examples, usually arranged as a table with one row per example.

Chapter 1: What Is Learning?

Decision boundary

The dividing line between the inputs a model labels one class and those it labels the other.

Chapter 6: Logistic Regression

Dense layer

A layer in which every neuron is connected to every input. Also called a fully connected layer.

Chapter 14: A Single Neuron

Derivative

How fast the output of a function changes when its input changes a little. On a graph it is the steepness of the curve at a point.

Toolkit 0.2: Derivatives and Gradients · See also partial derivative

Diverge

To blow up. Each step makes the loss larger than the last, usually because the learning rate is too big.

Chapter 3: Gradient Descent · See also learning rate

Dot product

Multiply the matching entries of two vectors and add the results. It gives one number that is large when the vectors point the same way.

Toolkit 0.1: Vectors and Matrices · See also vector

Dropout

Switching off a random share of neurons at every training step, so the network cannot rely on any single one. All neurons are used when predicting.

Chapter 19: Keeping Networks Honest · See also regularization

E

Early stopping

Ending training when the loss on held-out data stops improving, and keeping the weights from that point.

Chapter 19: Keeping Networks Honest · See also validation set

Epoch

One full pass through the training data.

Chapter 3: Gradient Descent · See also batch size

Euclidean distance

Ordinary straight-line distance. Square the difference in each feature, add them up, and take the square root.

Chapter 8: Nearest Neighbours

Example

One row of data, such as one student. Also called a sample or a data point.

Chapter 1: What Is Learning?

Expected value

The long-run average of a random quantity. Each possible value is weighted by how likely it is.

Toolkit 0.3: Probability

Extrapolation

Predicting for inputs outside the range the model was fitted on. The model has no evidence there, so it can be badly wrong.

Chapter 2: Linear Regression

F

F1 score

A single number combining precision and recall. It is high only when both are high.

Chapter 7: Measuring Classifiers

False negative

A yes that the model called no. A miss.

Chapter 7: Measuring Classifiers · See also false positive

False positive

A no that the model called yes. A false alarm.

Chapter 7: Measuring Classifiers · See also false negative

Feature

One measured property of an example that the model is allowed to look at, such as hours studied.

Chapter 1: What Is Learning? · See also label

Feature selection

Deciding which features a model should use and which it should ignore.

Chapter 5: Regularization

Flatten

To unroll a grid of numbers, such as an image, into one long list so that a dense layer can read it.

Chapter 21: A Real Dataset

Forward pass

Running an input through the network from the first layer to the last to get its output.

Chapter 15: Layers and Activations · See also backward pass

G

Generalize

To predict well on new examples that were not used to fit the model. This is the real goal of learning.

Chapter 1: What Is Learning?

Gradient

The list of slopes of the loss, one per parameter. It points in the direction in which the loss grows fastest.

Toolkit 0.2: Derivatives and Gradients

Gradient check

Testing a backward pass by comparing its gradients with slopes measured directly, by nudging each weight a little.

Chapter 17: Backpropagation

Gradient descent

Repeatedly nudging the parameters a small step against the gradient, so the loss goes down.

Chapter 3: Gradient Descent · See also learning rate, gradient

H

Hidden layer

A layer between the input and the output of a network. Its values are never seen directly; the network decides what they should mean.

Chapter 15: Layers and Activations

Hyperparameter

A setting you choose before training, such as the degree of a curve or the learning rate. The model does not learn it from the data.

Chapter 4: Generalization · See also parameter

I

Imbalanced data

Data in which one class is much rarer than the other, such as 1 ill patient for every 9 healthy ones.

Chapter 7: Measuring Classifiers

Independence

Two things are independent when knowing one tells you nothing about the other. Words in a message are not, which is why the assumption is called naive.

Toolkit 0.3: Probability

Inference

Using a trained model to make predictions. Only a forward pass is needed, with no loss and no weight updates.

Chapter 21: A Real Dataset

Instance-based learning

Learning by storing the examples themselves and comparing new cases against them, rather than fitting weights.

Chapter 8: Nearest Neighbours

K

k-nearest neighbours

A method that classifies a new point by finding the k most similar known points and taking a vote among them.

Chapter 8: Nearest Neighbours · See also curse of dimensionality

Kernel

A function that measures how similar two examples are. Using one lets a method that draws straight boundaries draw curved ones.

Chapter 10: Support Vector Machines · See also rbf kernel

L

Label

The known correct answer for an example, such as the exam score. Also called the target.

Chapter 2: Linear Regression · See also feature

Lasso

Least squares with a penalty on the sum of absolute weights. It pushes some weights to exactly zero, which removes those features.

Chapter 5: Regularization · See also ridge regression, sparse

Layer

A group of neurons that all receive the same inputs and each produce one output.

Chapter 14: A Single Neuron

Learning rate

The number that sets how far each step of gradient descent moves. Too small is slow, too large overshoots.

Chapter 3: Gradient Descent · See also learning-rate decay

Learning-rate decay

Gradually shrinking the learning rate during training, so that early steps are large and late steps are careful.

Chapter 18: Optimizers

Least squares

Choosing the model that makes the mean squared error as small as possible.

Chapter 2: Linear Regression

Likelihood

How probable the evidence is if a given answer were true, such as how often the word "free" turns up in spam.

Chapter 9: Naive Bayes · See also bayes' rule

Linear classifier

A classifier whose decision boundary is straight, a point with one feature, a line with two, a flat sheet with more.

Chapter 6: Logistic Regression

Log loss

The loss used for probabilities. It is the negative logarithm of the probability the model gave to what actually happened. Also called cross-entropy.

Chapter 6: Logistic Regression

Logistic regression

A model for yes/no questions. It computes a weighted sum of the features and squashes it into a probability between 0 and 1.

Chapter 6: Logistic Regression

Logits

The raw scores a network produces for each class, before softmax turns them into probabilities.

Chapter 16: Scoring a Classifier · See also softmax

Loss

A single number that says how wrong a model is on a set of examples. Lower is better, and zero is perfect.

Chapter 2: Linear Regression

M

Margin

The empty gap between a decision boundary and the closest training points on either side. A wider margin leaves more room for error.

Chapter 10: Support Vector Machines · See also support vector

Matrix

A rectangular table of numbers. A dataset with one row per example and one column per feature is a matrix.

Toolkit 0.1: Vectors and Matrices

Mean squared error

The average of the squared residuals. Squaring makes every miss positive and makes big misses count much more.

Chapter 2: Linear Regression · See also root mean squared error

Mini-batch

A small random handful of examples used to estimate the gradient cheaply for one step.

Chapter 3: Gradient Descent

Model

A rule with adjustable numbers that turns an input into a prediction. Learning means choosing those numbers.

Chapter 1: What Is Learning?

Momentum

Carrying part of the previous update into the next one. It builds up speed in directions that stay consistent and damps back-and-forth motion.

Chapter 18: Optimizers · See also adam

N

Naive Bayes

A classifier that applies Bayes' rule while pretending every feature is independent of the others. Simple, fast, and often good enough.

Chapter 9: Naive Bayes · See also independence

Neural network

A model made of layers of simple units called neurons, each feeding its output to the next layer.

Chapter 14: A Single Neuron

Neuron

The smallest unit of a neural network. It multiplies each input by a weight, adds the results and a bias, and passes on one number.

Chapter 14: A Single Neuron

Noise

The part of the data that no model could predict, such as luck on the day. It differs from one sample to the next.

Chapter 4: Generalization

Normal distribution

The bell-shaped curve. Values near the average are common and values far from it are rare, symmetrically on both sides.

Toolkit 0.3: Probability

O

One-hot

A way of writing a class as a list of zeros with a single 1 in the position of that class.

Chapter 16: Scoring a Classifier · See also cross-entropy

Optimizer

The rule that turns gradients into weight updates. Plain gradient descent is the simplest; Adam is the most widely used.

Chapter 18: Optimizers

Outlier

An example that sits far from the pattern the rest of the data follows.

Chapter 2: Linear Regression

Output layer

The last layer of a network. Its size and activation are chosen to match the kind of answer wanted, such as a probability, one class out of several, or a number.

Chapter 20: One Network, Many Jobs

Overfitting

When a model follows the accidents of its training data instead of the real pattern. It looks excellent on that data and does badly on new data.

Chapter 4: Generalization · See also underfitting, regularization

P

Parameter

One of the adjustable numbers inside a model. A line has two, its slope and its bias.

Chapter 1: What Is Learning? · See also hyperparameter

Partial derivative

The derivative with respect to one input while all the other inputs are held still.

Toolkit 0.2: Derivatives and Gradients · See also gradient

Pixel

One small square of an image. In a greyscale image each pixel is a single number giving its brightness.

Chapter 21: A Real Dataset

Posterior

How likely something is after taking the evidence into account. It is what Bayes' rule computes.

Chapter 9: Naive Bayes · See also prior, likelihood

Precision

Of everything the model flagged as yes, the share that really was yes. High precision means few false alarms.

Chapter 7: Measuring Classifiers · See also recall, f1 score

Prior

How likely something is before looking at the evidence. For spam, the share of all messages that are spam.

Chapter 9: Naive Bayes · See also posterior

Probability

A number from 0 to 1 saying how likely something is. 0 means never, 1 means certain, 0.5 means a coin flip.

Toolkit 0.3: Probability

R

R squared

The share of the variation in the target that the model explains. 1 is perfect, 0 is no better than always guessing the average.

Chapter 2: Linear Regression

Random variable

A quantity whose value is decided by chance, such as the total shown by two dice or the score a student will get.

Toolkit 0.3: Probability

RBF kernel

The most common kernel. It scores two points as similar when they are close together, with a setting for how quickly that similarity fades with distance.

Chapter 10: Support Vector Machines

Recall

Of everything that really was yes, the share the model flagged. High recall means few misses. Also called sensitivity.

Chapter 7: Measuring Classifiers · See also precision, f1 score

Regression

Predicting a number, such as a score or a price.

Chapter 1: What Is Learning? · See also classification

Regularization

Any change to training that discourages a model from fitting noise, usually a penalty on large weights.

Chapter 5: Regularization

ReLU

The rectified linear unit, the most common activation function. It turns negative numbers into zero and leaves positive numbers unchanged.

Chapter 15: Layers and Activations · See also activation function

Residual

The true value minus the prediction for one example. It is how far, and in which direction, the model missed.

Chapter 2: Linear Regression

Ridge regression

Least squares with a penalty on the sum of squared weights. It shrinks every weight toward zero but rarely to exactly zero.

Chapter 5: Regularization · See also lasso

ROC curve

A plot of the share of real yeses caught against the share of real noes wrongly flagged, for every possible threshold.

Chapter 7: Measuring Classifiers · See also auc

Root mean squared error

The square root of the mean squared error. It is in the same units as the thing being predicted.

Chapter 2: Linear Regression · See also mean squared error

S

Scalar

A single ordinary number, as opposed to a list of them.

Toolkit 0.1: Vectors and Matrices

Separable

Data in which one straight boundary divides the two classes with no mistakes at all.

Chapter 6: Logistic Regression

Shape

The size of a matrix, written rows × columns. A table of 12 students and 2 features has shape 12 × 2.

Toolkit 0.1: Vectors and Matrices

Sigmoid

The S-shaped function that turns any number into a value between 0 and 1. Large positive inputs give nearly 1, large negative ones nearly 0.

Chapter 6: Logistic Regression · See also logistic regression

Slope

How much the prediction changes when the input grows by one unit. Also called the weight.

Chapter 2: Linear Regression

Smoothing

Adding a small amount to every count so that nothing is ever judged impossible just because it was not in the training data.

Chapter 9: Naive Bayes

Soft margin

A margin that some points are allowed to cross, at a cost. It lets an SVM handle classes that overlap.

Chapter 10: Support Vector Machines · See also margin

Softmax

A function that turns a list of scores into probabilities. Every result is positive, they add up to 1, and a higher score gets a larger share.

Chapter 16: Scoring a Classifier · See also logits

Sparse

Having most entries equal to zero. A sparse model uses only a few of its features.

Chapter 5: Regularization

Standard deviation

A measure of spread. Roughly, the typical distance of a value from the average. It is the square root of the variance.

Toolkit 0.3: Probability

Standardize

Rescale a feature so that its average is 0 and its typical spread is 1. It puts features on a common footing.

Chapter 5: Regularization · See also euclidean distance

Stochastic gradient descent

Gradient descent where each step uses a random mini-batch instead of the whole dataset. Noisier, but far cheaper per step.

Chapter 3: Gradient Descent · See also mini-batch

Supervised learning

Learning from examples that come with the right answer attached, so the model can be corrected.

Chapter 1: What Is Learning?

Support vector

A training point that sits on the edge of the margin, or inside it. These points alone determine where the boundary goes.

Chapter 10: Support Vector Machines

Support vector machine

A classifier that chooses the boundary with the widest possible margin between the classes.

Chapter 10: Support Vector Machines

T

Test set

Examples held back and never used for fitting, so they can show how the model does on data it has not seen.

Chapter 1: What Is Learning? · See also data leakage

Threshold

The cut-off probability above which a model answers yes. 0.5 is the usual default, but it is a choice.

Chapter 6: Logistic Regression · See also decision boundary

Training

The process of adjusting the parameters of a model so that its predictions match the examples.

Chapter 1: What Is Learning?

Training loop

The cycle that trains a network. Forward pass, measure the loss, backward pass, update the weights, and repeat.

Chapter 17: Backpropagation

U

Underfitting

When a model is too simple to follow the real pattern. It does badly on the data it was fitted to and on new data alike.

Chapter 4: Generalization · See also overfitting

V

Validation set

Examples held back from fitting and used to choose between models or settings. Not the same as the test set.

Chapter 4: Generalization · See also cross-validation

Variance (of a model)

How much the fitted model changes when it is trained on a different sample of data. Flexible models have more of it.

Chapter 4: Generalization · See also bias (of a model)

Vector

An ordered list of numbers. It can describe one example by its features, or be drawn as an arrow.

Toolkit 0.1: Vectors and Matrices

W

Weight

A learned number that says how strongly one input affects a neuron's output, and in which direction.

Chapter 14: A Single Neuron · See also parameter

Weight penalty

An extra term in the loss that grows with the size of the weights, so the network prefers small ones. With squared weights it is called L2 regularization or weight decay.

Chapter 19: Keeping Networks Honest · See also ridge regression

Search

    The Book of Machine Learning
    Search
    Reading settings
    Text size
    Colours

    Saved in this browser only.

    Keyboard shortcuts
    /
    Search the book
    ← →
    Previous and next chapter
    g
    Glossary
    c
    Table of contents
    e
    Jump to the exercises
    t
    Reading settings
    ?
    Show this list
    Esc
    Close a window or pop-in