Skip to content
VibeFormer

Reference

Glossary

Every term is defined in exactly one place — here — and lessons pull from this list rather than restating it. So the definition you read in a lesson and the one on this page cannot drift apart.

82 terms

Learning

Machine learning

The construction of a function from examples rather than from explicitly written rules. A learning algorithm searches a set of candidate functions for one that reproduces observed input–output pairs and generalises to unseen inputs.

In plain words: You supply examples; the computer works out the rule. You write the search procedure, not the rule.

What Machine Learning Actually Is
Hypothesis spacealso: hypothesis class, model class

The set of functions a learning algorithm is permitted to return, written ℋ. Restricting ℋ is what makes generalisation possible; an unrestricted ℋ provides no reason to prefer one data-fitting function over another.

H={hθ:XY  :  θΘ}\mathcal{H} = \{\, h_\theta : \mathcal{X} \to \mathcal{Y} \;:\; \theta \in \Theta \,\}

In plain words: The shapes of answer you allow the model to consider.

Formulating a Learning Problem
Inductive bias

The set of assumptions a learning algorithm makes about which patterns are plausible, encoded by its choice of hypothesis space and objective. Every algorithm has one, and no algorithm can learn without one.

In plain words: The assumption the model brings before it sees any data.

The No Free Lunch Theorem
Fitting

The process of choosing parameter values that minimise a loss function on the training data. Fitting is distinct from learning: a model that fits perfectly may have memorised rather than generalised.

In plain words: Adjusting the model's numbers so it matches the training examples.

Empirical Risk Minimisation
Generalisation

Performance on data not used during fitting. It is the only thing a model is ultimately judged on, and it is measured by the true risk R(h) rather than the empirical risk on the training sample.

In plain words: Doing well on examples the model has never seen.

Generalisation, Overfitting and Underfitting

Error and risk

Generalisation gap

The difference between true risk and empirical risk for the fitted model, R(ĥ) − R̂(ĥ). Estimated in practice as validation error minus training error.

gap=R(h^)R^(h^)\text{gap} = R(\hat h) - \hat R(\hat h)
Generalisation, Overfitting and Underfitting
Bias

The difference between the true value and the average prediction of a model fitted across many independent training samples. Bias is systematic error: it does not shrink as sample size grows, and averaging many models does not remove it.

Bias(x)=f(x)E[f^(x)]\text{Bias}(x) = f(x) - \E\big[\hat f(x)\big]

In plain words: The model is consistently wrong in the same direction, because it is too rigid to represent the truth.

The Bias–Variance Trade-off
Variance (of a model)

The expected squared deviation of a model's prediction from its own average prediction, taken over the randomness in which training sample was drawn. Variance is instability: a high-variance procedure gives very different models from similar datasets.

Var(f^(x))=E[(f^(x)E[f^(x)])2]\Var\big(\hat f(x)\big) = \E\Big[\big(\hat f(x) - \E[\hat f(x)]\big)^2\Big]

In plain words: The model changes a lot depending on which particular examples it happened to be trained on.

The Bias–Variance Trade-off
Noise (irreducible error)also: irreducible error, Bayes error

Variation in the target that no function of the available inputs can explain, with variance σ². It sets a floor on achievable error: even a perfect model attains σ², so no amount of data or model capacity reduces it.

y=f(x)+ε,E[ε]=0,Var(ε)=σ2y = f(x) + \varepsilon, \qquad \E[\varepsilon] = 0, \quad \Var(\varepsilon) = \sigma^2

In plain words: Randomness in the outcome itself. Two identical inputs can have different labels, and nothing can predict which.

The Bias–Variance Trade-off
Overfitting

Fitting patterns present in the training sample but not in the wider distribution, typically its noise. Diagnosed by low training error together with substantially higher validation error.

In plain words: The model memorised the training data, including its accidents.

Generalisation, Overfitting and Underfitting
Underfitting

Failing to capture structure that is present in the data, because the hypothesis space is too restricted or the model is too heavily constrained. Diagnosed by high training error and validation error of similar size.

In plain words: The model is too simple to represent the pattern that is actually there.

Generalisation, Overfitting and Underfitting
Riskalso: true risk, expected loss

The expected loss of a hypothesis over the whole data distribution. It is the quantity we want to minimise and cannot compute, because the distribution is unknown.

R(h)=E(x,y)D[L(y,h(x))]R(h) = \E_{(x,y)\sim\mathcal{D}}\big[L(y, h(x))\big]
Empirical Risk Minimisation
Empirical riskalso: training error

The average loss over the training sample. It is computable and is used as a proxy for true risk, but it is optimistically biased for any hypothesis chosen by minimising it.

R^(h)=1ni=1nL(yi,h(xi))\hat R(h) = \frac{1}{n}\sum_{i=1}^{n} L\big(y_i, h(x_i)\big)
Empirical Risk Minimisation
Loss function

A function L(y, ŷ) ≥ 0 giving the cost of predicting ŷ when the truth is y. It encodes which mistakes matter and by how much; changing it changes what the fitted model optimises for.

Formulating a Learning Problem

Capacity and regularisation

Regularisation

Any modification to a learning procedure that reduces variance by constraining the effective capacity of the model, usually at the cost of some additional bias. It includes penalty terms added to the objective, but also early stopping, dropout and data augmentation.

J(w)=1ni=1nL(yi,hw(xi))+λΩ(w)J(w) = \frac{1}{n}\sum_{i=1}^{n} L\big(y_i, h_w(x_i)\big) + \lambda\,\Omega(w)

In plain words: Making the model pay a price for complexity, so it prefers simpler explanations.

Regularisation
L2 regularisationalso: ridge penalty, weight decay, Tikhonov regularisation

A penalty proportional to the sum of squared weights. It shrinks all coefficients proportionally towards zero without setting any exactly to zero, and stabilises estimates when predictors are correlated.

Ω(w)=w22=j=1dwj2\Omega(w) = \norm{w}_2^2 = \sum_{j=1}^{d} w_j^2

In plain words: Penalise large coefficients, shrinking them all by the same proportion.

Regularisation
L1 regularisationalso: lasso penalty

A penalty proportional to the sum of absolute weights. Unlike L2 it drives some coefficients to exactly zero, so it performs feature selection as a side effect of fitting.

Ω(w)=w1=j=1dwj\Omega(w) = \norm{w}_1 = \sum_{j=1}^{d} \abs{w_j}

In plain words: Penalise coefficient size in a way that switches useless features off entirely.

Regularisation
Elastic net

A regularisation penalty combining L1 and L2 terms. It retains L1's ability to zero out coefficients while sharing weight among correlated features as L2 does, which stabilises the selection.

Ω(w)=αw1+(1α)w22\Omega(w) = \alpha\norm{w}_1 + (1-\alpha)\norm{w}_2^2
Regularisation
Capacityalso: model complexity, effective capacity

How rich a set of functions a model can express. It is affected by parameter count, but also by regularisation strength, training duration, and how many decisions were made using the data.

Generalisation, Overfitting and Underfitting

Evaluation

Training set

The portion of data used to fit model parameters. Error measured on it is optimistically biased and must not be reported as model performance.

Train, Validation and Test Splits
Validation set

Data held out from fitting and used to choose between models or hyperparameter settings. Because it informs selection, its error is also optimistically biased, increasingly so with the number of configurations compared.

Train, Validation and Test Splits
Test set

Data used exactly once, after all decisions are final, to obtain an unbiased performance estimate. Any change made in response to a test score converts it into a validation set.

Train, Validation and Test Splits
Cross-validation

Repeatedly partitioning the data into training and validation folds so that every observation serves as validation exactly once, then averaging the fold scores. Reduces the variance of the performance estimate relative to a single split.

CVk=1kj=1kR^(j)\text{CV}_k = \frac{1}{k}\sum_{j=1}^{k} \hat R^{(j)}
Cross-Validation
Data leakage

The presence in training of information that will not be available at prediction time. It inflates measured performance and is uniquely dangerous because it makes results look better rather than worse.

Pipelines and Data Leakage
Precision

Of the cases the model predicted positive, the fraction that truly are positive. Its denominator is the model's predictions, which makes it a posterior probability and therefore sensitive to class balance.

Precision=TPTP+FP\text{Precision} = \frac{TP}{TP + FP}
Classification Metrics
Recallalso: sensitivity, true positive rate

Of the cases that truly are positive, the fraction the model identified. Its denominator is the actual positives, so unlike precision it does not depend on how many predictions were made.

Recall=TPTP+FN\text{Recall} = \frac{TP}{TP + FN}
Classification Metrics
Calibration

The property that predicted probabilities match observed frequencies: among cases assigned probability p, a fraction p are positive. Independent of ranking quality — a model can rank perfectly and be badly calibrated.

Probability Calibration

Probability

Random variable

A function mapping each outcome of an experiment to a number. It is a function, not a number: the notation X = x denotes the event consisting of all outcomes that X maps to x.

X:ΩRX : \Omega \to \R
Random Variables
Expectationalso: expected value, mean

The probability-weighted average of a random variable's values — the balance point of its distribution. Need not be an attainable value.

E[X]=xxp(x)orxf(x)dx\E[X] = \sum_x x\,p(x) \quad\text{or}\quad \int x f(x)\,dx
Expectation
Variance (of a random variable)

The expected squared deviation of a random variable from its mean, measuring spread. Not linear: Var(aX) = a²Var(X), and variances of independent variables add even when the variables are subtracted.

Var(X)=E[(Xμ)2]=E[X2](E[X])2\Var(X) = \E\big[(X-\mu)^2\big] = \E[X^2] - \big(\E[X]\big)^2
Variance, Moments and Generating Functions
Independence

Two events are independent when the probability of both equals the product of their probabilities — equivalently, when knowing one occurred does not change the probability of the other. Distinct from mutual exclusivity, which concerns addition rather than multiplication.

P(AB)=P(A)P(B)\Prob(A \cap B) = \Prob(A)\Prob(B)
Events, Independence and Mutual Exclusivity
i.i.d.also: independent and identically distributed

Two separate assumptions about a sample: each observation carries no information about the others, and all are drawn from the same distribution. Nearly every guarantee in statistics and learning theory depends on it, and real data frequently violates it.

(xi,yi)i.i.d.D(x_i, y_i) \stackrel{\text{i.i.d.}}{\sim} \mathcal{D}
What Machine Learning Actually Is

Statistics

Standard error

The standard deviation of a statistic across hypothetical repeated samples. For a sample mean of independent observations it is σ/√n, which is why halving uncertainty requires four times the data.

SE(Xˉ)=σn\text{SE}(\bar X) = \frac{\sigma}{\sqrt{n}}
The Central Limit Theorem
Overdispersion

Count data whose variance exceeds what the assumed model allows — for Poisson, variance greater than the mean. Indicates that events cluster or that the rate varies, and fitting the simpler model produces intervals that are too narrow.

The Poisson Distribution

Optimisation

Gradient descent

An iterative minimisation method that repeatedly steps in the direction of steepest decrease of the objective, scaled by a learning rate.

θt+1=θtηJ(θt)\theta_{t+1} = \theta_t - \eta\,\nabla J(\theta_t)
Gradient Descent
Convexity

A function is convex if the line segment between any two points on its graph lies on or above the graph. Convex objectives have no non-global local minima, which is why convex problems are considered solved.

Convex Sets and Convex Functions
Hyperparameter

A setting chosen before fitting that is not determined by the training objective — regularisation strength, tree depth, learning rate, number of neighbours. Chosen by search against validation performance rather than learned.

Hyperparameter Search
Learning ratealso: step size, η

The scalar multiplying the gradient in an iterative update, controlling how far each step moves. Too large and the iterates oscillate or diverge; too small and progress is needlessly slow.

Gradient Descent
Coordinate descent

Minimising an objective by optimising one coordinate at a time, holding the rest fixed, and cycling through coordinates until convergence. Effective when each one-dimensional subproblem has a closed form.

Lasso and Elastic Net
Soft-thresholding operator

The function that shrinks a number towards zero by a fixed amount and clamps it at zero once it would cross. It is the exact solution of the one-dimensional L1-penalised least-squares problem, which is why lasso produces exact zeros.

Sλ(z)=sign(z)max(zλ,  0)S_\lambda(z) = \operatorname{sign}(z)\max(|z| - \lambda,\; 0)
Lasso and Elastic Net
Lagrangian duality

The reformulation of a constrained minimisation as a maximisation over multipliers on the constraints. The dual optimum never exceeds the primal optimum, and under convexity plus mild conditions the two coincide.

The SVM Dual Problem
KKT conditionsalso: Karush–Kuhn–Tucker conditions

The first-order conditions a point must satisfy to solve a constrained optimisation problem: stationarity, primal and dual feasibility, and complementary slackness. For convex problems they are sufficient as well as necessary.

The SVM Dual Problem

Models and algorithms

Residual

The signed difference between an observed target and the value a fitted model predicts for it, ei=yiy^ie_i = y_i - \hat y_i. Residuals are observable; the errors they estimate are not.

In plain words: How far off the model was on one data point, with a sign telling you which direction.

Simple Linear Regression
Least squaresalso: ordinary least squares, OLS

The criterion that selects the parameters minimising the sum of squared residuals. Squaring makes the objective differentiable and penalises large misses disproportionately, and yields a closed-form solution for linear models.

β^=arg minβi=1n(yixiTβ)2\hat\beta = \argmin_\beta \sum_{i=1}^{n}\left(y_i - x_i\T\beta\right)^2
Simple Linear Regression
Design matrix

The n×pn \times p matrix XX whose rows are observations and columns are features, usually with a leading column of ones to carry the intercept. Every linear-model formula is written in terms of it.

Multiple Linear Regression
Multicollinearity

The condition in which one feature is closely predictable from a linear combination of the others. It leaves predictions largely intact but makes individual coefficients unstable and their standard errors large, because the data cannot distinguish which correlated feature deserves the credit.

Multiple Linear Regression
Homoscedasticityalso: constant variance

The assumption that the error variance is the same for every observation, Var(εi)=σ2\Var(\varepsilon_i) = \sigma^2 for all ii. Its failure — heteroscedasticity — leaves coefficient estimates unbiased but invalidates the usual standard errors.

In plain words: The spread of the errors does not grow or shrink as the prediction changes.

Regression Assumptions and Diagnostics
Basis function

A fixed nonlinear transformation of the input used as a feature, so that a model linear in its parameters can represent a nonlinear function of the original input. Polynomial terms, splines and radial bumps are all basis functions.

f(x)=j=1Mβjϕj(x)f(x) = \sum_{j=1}^{M} \beta_j \phi_j(x)
Polynomial and Basis Expansion Regression
Odds

The ratio of the probability that an event occurs to the probability that it does not, p/(1p)p/(1-p). Odds run from 0 to infinity while probability runs from 0 to 1.

Logistic Regression
Log-oddsalso: logit

The natural logarithm of the odds. It maps a probability in (0,1)(0,1) onto the whole real line, which is what allows an unbounded linear predictor to model a bounded probability.

logit(p)=logp1p\operatorname{logit}(p) = \log\frac{p}{1-p}
Logistic Regression
Sigmoid functionalso: logistic function

The S-shaped function mapping the real line onto (0,1)(0,1). It is the inverse of the logit, so it converts a linear predictor back into a probability.

σ(z)=11+ez\sigma(z) = \frac{1}{1 + e^{-z}}
Logistic Regression
Softmax function

The function converting a vector of real scores into a probability distribution by exponentiating each entry and dividing by the total. It generalises the sigmoid from two classes to many.

softmax(z)k=ezkj=1Kezj\operatorname{softmax}(z)_k = \frac{e^{z_k}}{\sum_{j=1}^{K} e^{z_j}}
Multinomial Logistic Regression
Cross-entropy lossalso: log loss, negative log-likelihood

The loss that charges a model the negative logarithm of the probability it assigned to the observed label. It is the negative log-likelihood of a categorical model, and it diverges when a model is confidently wrong.

J=1ni=1nk=1Kyiklogp^ikJ = -\frac{1}{n}\sum_{i=1}^{n}\sum_{k=1}^{K} y_{ik}\log \hat p_{ik}
Logistic Regression
Decision boundary

The set of input points at which a classifier is exactly indifferent between two classes. Its shape — a hyperplane, a quadric, an axis-aligned staircase — is the clearest summary of what a classifier can and cannot express.

Logistic Regression
Generative classifier

A classifier that models the joint distribution of features and label, usually as a class prior times a class-conditional density, then applies Bayes' theorem to obtain the posterior. Naive Bayes, LDA and QDA are generative.

p(x,y)=p(y)p(xy)p(x, y) = p(y)\,p(x \mid y)
Naive Bayes Classifiers
Discriminative classifier

A classifier that models the conditional distribution of the label given the features directly, without describing how the features are distributed. Logistic regression, SVMs and neural networks are discriminative.

p(yx)p(y \mid x)
Naive Bayes Classifiers
Laplace smoothingalso: additive smoothing, add-one smoothing

Adding a positive constant to every observed count before converting counts to probabilities, so that no outcome receives probability zero. Without it, a single unseen feature value can zero out an entire product of probabilities.

p^j=nj+αn+αm\hat p_j = \frac{n_j + \alpha}{n + \alpha m}
Naive Bayes Classifiers
Lazy learningalso: instance-based learning, memory-based learning

A strategy that stores the training data and defers all computation to prediction time, rather than fitting parameters in advance. k-nearest neighbours is the canonical example: training is free, prediction is expensive.

k-Nearest Neighbours
Impurity

A scalar measuring how mixed the class labels are within a subset of the data. Zero for a subset containing one class only, maximal when all classes are equally represented. Entropy and Gini impurity are the two measures in standard use.

Decision Trees: Entropy and Gini
Entropy

The average information content of a random label, in bits. Used as an impurity measure it is zero for a pure node and log2K\log_2 K for KK equally likely classes.

H(S)=k=1Kpklog2pkH(S) = -\sum_{k=1}^{K} p_k \log_2 p_k
Decision Trees: Entropy and Gini
Gini impurity

The probability that two items drawn independently at random from a node carry different labels. Zero for a pure node, 11/K1 - 1/K for a uniform mix over KK classes.

G(S)=1k=1Kpk2G(S) = 1 - \sum_{k=1}^{K} p_k^2
Decision Trees: Entropy and Gini
Information gain

The reduction in impurity produced by a split, with each child's impurity weighted by the fraction of examples reaching it. A decision tree chooses, at each node, the split maximising it.

IG(S)=H(S)vSvSH(Sv)IG(S) = H(S) - \sum_v \frac{|S_v|}{|S|} H(S_v)
Decision Trees: Entropy and Gini
Pruning

Removing subtrees from a grown decision tree to reduce its capacity. Cost-complexity pruning does this by penalising leaf count, collapsing any subtree whose accuracy gain does not pay for its size.

CART, Pruning and Regression Trees
Linear separability

A labelled dataset is linearly separable if some hyperplane places every positive example strictly on one side and every negative example strictly on the other. XOR is the standard example of a dataset that is not.

The Perceptron
Margin

The perpendicular distance from a separating hyperplane to the nearest training point. A support vector machine selects, among all separating hyperplanes, the one maximising this distance.

margin=1w\text{margin} = \frac{1}{\norm{w}}
Support Vector Machines
Hinge loss

The loss charging zero once an example is classified correctly with margin at least one, and growing linearly in the shortfall otherwise. Its flat region is what makes most training points irrelevant to the fitted SVM.

(y,f(x))=max ⁣(0,  1yf(x))\ell(y, f(x)) = \max\!\left(0,\; 1 - y f(x)\right)
Support Vector Machines
Support vector

A training point with a nonzero dual coefficient — one lying on or inside the margin. The fitted decision function depends only on these points; deleting any other training point leaves the solution unchanged.

The SVM Dual Problem
Kernel function

A function returning the inner product of two inputs after some feature map, K(x,x)=ϕ(x),ϕ(x)K(x,x') = \langle\phi(x),\phi(x')\rangle, computable without ever forming ϕ\phi. Any symmetric positive semi-definite function is a valid kernel.

Kernel Methods
Kernel trick

Replacing every inner product in an algorithm by a kernel evaluation, so the algorithm operates in a high- or infinite-dimensional feature space at the cost of working in the original one.

Kernel Methods
Activation function

The scalar nonlinearity applied to each unit's weighted input in a neural network. Without one, stacking layers collapses to a single linear map and depth buys nothing.

Multi-Layer Perceptrons and Feed-Forward Networks
Universal approximation

The result that a feed-forward network with one hidden layer and a non-polynomial activation can approximate any continuous function on a compact set to arbitrary accuracy, given enough hidden units. It is an existence statement, not a guarantee that training will find such a network.

Multi-Layer Perceptrons and Feed-Forward Networks

Ensembles

Ensemble

A model that combines the predictions of several base models, by averaging, voting or a learned combination. Ensembles improve on their members when the members' errors are not perfectly correlated.

Bagging and Random Forests
Bootstrap sample

A sample of size nn drawn with replacement from a dataset of size nn. Each such sample omits about 36.8% of the original rows, which is what supplies bagging with its out-of-bag validation set.

Resampling: Bootstrap and Permutation
Baggingalso: bootstrap aggregation

Training one model per bootstrap sample and averaging their predictions. It reduces variance without increasing bias, so it helps exactly those models that are unstable — deep trees above all.

Bagging and Random Forests
Out-of-bag erroralso: OOB error

An estimate of generalisation error computed by predicting each training row using only the ensemble members whose bootstrap sample excluded it. It is nearly free and behaves much like k-fold cross-validation.

Bagging and Random Forests
Boosting

Fitting base models in sequence, each one targeting the errors its predecessors made, and summing their contributions. Unlike bagging it reduces bias, and unlike bagging it can overfit as members are added.

AdaBoost
Weak learner

A model required only to beat random guessing by some margin. Boosting theory shows that a weak learner, applied repeatedly to reweighted data, can be combined into an arbitrarily accurate predictor.

AdaBoost
Shrinkagealso: learning rate (boosting)

Scaling each boosting stage's contribution by a factor below one, so that progress is made in many small steps rather than a few large ones. Smaller shrinkage needs more stages but generalises better.

Fm(x)=Fm1(x)+νhm(x),0<ν1F_m(x) = F_{m-1}(x) + \nu\, h_m(x), \quad 0 < \nu \le 1
Gradient Boosting
Out-of-fold prediction

A prediction for a training row produced by a model that did not see that row during fitting. Stacking must be built from out-of-fold predictions, or the meta-learner trains on leaked information.

Stacking and Blending

Interpretability

Permutation importance

A feature's importance measured as the drop in validation performance when its values are randomly shuffled, breaking its association with the target while leaving its marginal distribution intact.

Model Interpretability
Partial dependence

The average predicted value as one feature is varied across its range, with all other features held at their observed values and then averaged over. It shows a model's marginal response, not a causal effect.

PDj(v)=1ni=1nf^ ⁣(v,xi,j)\text{PD}_j(v) = \frac{1}{n}\sum_{i=1}^{n} \hat f\!\left(v,\, x_{i,-j}\right)
Model Interpretability
SHAP value

A per-prediction feature attribution defined as that feature's Shapley value in a game whose payoff is the model output. It is the unique attribution satisfying efficiency, symmetry, dummy and additivity.

Model Interpretability

All terms, A–Z