Glossary
126 terms, each in a sentence or two, with the chapter that introduces it.
No term matches. Try the search page, which looks inside the chapters too.
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.
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.
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.
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.
Bias
The prediction when the input is zero, where the line crosses the vertical axis. Also called the intercept.
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.
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.
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".
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.
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.
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.
Decision boundary
The dividing line between the inputs a model labels one class and those it labels the other.
Dense layer
A layer in which every neuron is connected to every input. Also called a fully connected layer.
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
Euclidean distance
Ordinary straight-line distance. Square the difference in each feature, add them up, and take the square root.
Example
One row of data, such as one student. Also called a sample or a data point.
Expected value
The long-run average of a random quantity. Each possible value is weighted by how likely it is.
Extrapolation
Predicting for inputs outside the range the model was fitted on. The model has no evidence there, so it can be badly wrong.
F
F1 score
A single number combining precision and recall. It is high only when both are high.
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.
Flatten
To unroll a grid of numbers, such as an image, into one long list so that a dense layer can read it.
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.
Gradient
The list of slopes of the loss, one per parameter. It points in the direction in which the loss grows fastest.
Gradient check
Testing a backward pass by comparing its gradients with slopes measured directly, by nudging each weight a little.
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.
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.
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.
Inference
Using a trained model to make predictions. Only a forward pass is needed, with no loss and no weight updates.
Instance-based learning
Learning by storing the examples themselves and comparing new cases against them, rather than fitting weights.
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.
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.
Least squares
Choosing the model that makes the mean squared error as small as possible.
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.
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.
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.
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.
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.
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.
Model
A rule with adjustable numbers that turns an input into a prediction. Learning means choosing those numbers.
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.
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.
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.
Normal distribution
The bell-shaped curve. Values near the average are common and values far from it are rare, symmetrically on both sides.
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.
Outlier
An example that sits far from the pattern the rest of the data follows.
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.
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.
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.
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.
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.
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.
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.
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.
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
Separable
Data in which one straight boundary divides the two classes with no mistakes at all.
Shape
The size of a matrix, written rows × columns. A table of 12 students and 2 features has shape 12 × 2.
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.
Smoothing
Adding a small amount to every count so that nothing is ever judged impossible just because it was not in the training data.
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.
Standard deviation
A measure of spread. Roughly, the typical distance of a value from the average. It is the square root of the variance.
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.
Support vector
A training point that sits on the edge of the margin, or inside it. These points alone determine where the boundary goes.
Support vector machine
A classifier that chooses the boundary with the widest possible margin between the classes.
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.
Training loop
The cycle that trains a network. Forward pass, measure the loss, backward pass, update the weights, and repeat.
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.
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