Normalization
Normalisation is rescaling data to a common range or distribution, for example squeezing every feature to between 0 and 1, so that a machine learning model trains faster and gives each feature appropriate weight.
Raw data comes in wildly different scales. In a housing dataset, the number of bedrooms might run from 1 to 6 while the price runs into the hundreds of thousands. Many learning methods are thrown off by this: the large-valued feature dominates, training converges slowly, and in extreme cases numbers overflow. Normalisation rescales each feature so they span similar ranges.
Google's Machine Learning Crash Course describes the common techniques. Linear or min-max scaling maps values onto a fixed range, so a quantity of 300 in a range of 100 to 900 becomes 0.25. Z-score scaling expresses each value as standard deviations from the mean, so 130 with a mean of 100 and a standard deviation of 20 becomes 1.5. Log scaling tames heavy-tailed data such as book sales, and clipping caps extreme values. Which to use depends on how the data is distributed.
One rule is strict: the scaling must be worked out on the training data and then applied unchanged to new data. If the mean and range are calculated using test data as well, information leaks from the test set into training and scores look better than they should. Libraries such as scikit-learn put scalers in pipelines to enforce this.
Normalisation also happens inside neural networks. Batch normalisation, introduced by Sergey Ioffe and Christian Szegedy in 2015, rescales the inputs to a layer using statistics from each mini-batch of training data. Layer normalisation, proposed by Jimmy Ba, Jamie Kiros and Geoffrey Hinton in 2016, uses the statistics of a single training example instead, so it does not depend on batch size and works in recurrent networks. The shared idea is keeping numbers on a consistent footing as they pass through the model.
Features measured on very different scales can make training slow and unstable, and let large-valued features dominate small ones. Rescaling them to similar ranges helps many models converge faster and weigh each feature on its merits. The words are used loosely. In scikit-learn's documentation, standardisation means rescaling a feature to a mean of 0 and a variance of 1, while normalisation means scaling each individual example to unit length. Many courses use normalisation as the umbrella term for all feature scaling, including min-max and z-score methods. Not all, but many do. scikit-learn's documentation notes that parts of some methods, such as the RBF kernel of support vector machines and the regularisers of linear models, may assume features are centred near zero with similar variance, and that a feature with far larger variance can dominate what they learn. The best method is the one that suits each feature's distribution. Batch normalisation is a layer inside a neural network that rescales its inputs using the mean and variance of the current mini-batch. Its 2015 paper reported reaching the same accuracy on an image classifier with 14 times fewer training steps. Layer normalisation, a 2016 variant, works on each example separately.Common questions
Why is normalisation needed in machine learning?
What is the difference between normalisation and standardisation?
Do all models need normalised data?
What is batch normalisation?
Search for "feature scaling min-max z-score", "normalization data leakage" or "batch normalization vs layer normalization". Reliable sources include machine learning courses from major providers, documentation for libraries such as scikit-learn, and the original papers on arXiv for normalisation layers. Note that "normalization" also means something different in database design, so check the context of what you read.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.