Skip to content
AI360Xpert
Glossary
Definition

Standardization

Rescaling a column by subtracting its mean and dividing by its standard deviation, so it ends up centred at 0 with unit spread.

Written z=(xμ)/σz = (x - \mu)/\sigma, where μ\mu is the mean and σ\sigma the standard deviation. The output is unbounded, unlike min-max scaling, and it's the default choice for anything that computes a distance, a dot product, or a penalty across columns.

The mean and standard deviation are fitted — learned from rows — which is the part that causes bugs. Fit them on all your data before splitting and the held-out rows have been scaled using knowledge of themselves, so persist the two numbers with the model artefact and never recompute them at serving.

One trap on sparse data: subtracting a mean turns every stored zero into a non-zero, destroying sparsity and often the available memory with it. Use with_mean=False or scale by the maximum absolute value instead.