IAE Academy

Machine Learning formula sheet

103 formulas in 7 topics, each with when to use it. Each is explained in the topic notes.

Mean squared error (MSE)

Average squared residual; the sum of squared errors (SSE) is the same without the factor . Minimising either gives the same .

Least-squares slope and intercept

Needs at least two distinct values (). The fitted line always passes through .

Sigmoid (logistic function)

The output lies in (0, 1). ; as and as .

Sigmoid identities

The derivative is at most 0.25, reached at . This identity is what makes the gradient of the cross-entropy loss so simple.

Distance of a point from a hyperplane

Euclidean distance from to the hyperplane , for .

LDA parameter estimates (pooled covariance)

Class means, priors and the pooled within-class covariance, where is the number of samples in class . Dividing by instead of only rescales . With equal priors the decisions are unchanged. With unequal priors the term gets a slightly different relative weight, so borderline decisions can change.

Bias of an estimator at

Systematic error: how far the average prediction over training sets is from the truth.

Variance of an estimator at

Sensitivity: how much the prediction changes from one training set to another.

Perceptron output (step activation)

Targets are 0 or 1. The tie z = 0 is assigned to class 1 here. A question may use the opposite tie rule or targets of -1 and +1, so read the convention given.

Perceptron learning rule

Applied sample by sample, where t is the target. If the sample is classified correctly, t - y is 0 and nothing changes. A missed class-1 sample pulls w towards x, and a missed class-0 sample pushes w away from x.

Euclidean distance

Default distance. k-means is built around its square.

Manhattan distance

Sum of absolute coordinate differences. For (1,1) and (4,5): Manhattan = 3 + 4 = 7, Euclidean = 5.

Sample mean and centred data

Centre each feature (column) to mean zero. denotes the centred matrix, whose rows are .

Sample covariance matrix

Symmetric and positive semi-definite. Diagonal entries are feature variances; off-diagonal entries are covariances. Some texts divide by instead. The eigenvectors and the proportions of variance do not change; every eigenvalue is scaled by the same factor.