Standardization › Mathematical Foundation

Michael BrenndoerferApril 25, 20251 min read
Machine Learning from ScratchAll chapters
Part 3 of 9Foundations
Chapter 25Standardization › Mathematical Foundation
Reading section 3 of 10 · Mathematical Foundation · 1 minSection 3 of 10 · 1 min

Book contents

Section 3 of 10 · 1 min read

Standardization › Mathematical FoundationOne section · Sections in this chapter3 / 10 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The Standardization Formula

For a feature jj with nn observations, standardization transforms each value xijx_{ij} to zijz_{ij} using:

zij=xij−xˉjsjz_{ij} = \frac{x_{ij} - \bar{x}_j}{s_j}

where:

  • zijz_{ij} is the standardized value of feature jj for observation ii
  • xˉj=1n∑i=1nxij\bar{x}_j = \frac{1}{n}\sum_{i=1}^n x_{ij} is the mean of feature jj
  • sj=1n∑i=1n(xij−xˉj)2s_j = \sqrt{\frac{1}{n}\sum_{i=1}^n (x_{ij} - \bar{x}_j)^2} is the standard deviation of feature jj

Key Properties

After standardization, each feature in your dataset is transformed so that it has a mean of zero and a standard deviation of one. This transformation ensures that all features, regardless of their original scale or units, are directly comparable and contribute equally to the analysis. In practical terms, this means that no single feature will dominate the learning process simply because it has larger numeric values. Instead, every feature is centered and scaled, allowing algorithms.especially those sensitive to feature magnitude, such as regularized regression or clustering.to perform optimally and fairly.

  • Mean: zˉj=0\bar{z}_j = 0 for all features
  • Standard deviation: szj=1s_{z_j} = 1 for all features
  • Variance: Var(zj)=1\text{Var}(z_j) = 1 for all features

This ensures that all features contribute equally to distance calculations and regularization penalties.