Feature scaling changes the geometry seen by an optimizer

← Back to Blog & Articles

Features measured on very different scales can make an optimization problem difficult to traverse with a single learning rate. Scaling changes the numerical geometry of the parameter search.

Worked example

Imagine a linear model using distance in meters and duration in hours. A change of one in the distance feature has a different practical meaning from a change of one in the duration feature. Standardization subtracts a training-set mean and divides by a training-set standard deviation, giving each nonconstant feature a comparable numerical scale.

What to check

Estimate scaling statistics from the training partition and apply those stored statistics to validation and test data. Computing them using the test set leaks information about that set into the procedure. Handle a constant feature explicitly because its standard deviation is zero. Scaling may improve numerical behavior, but it also changes the meaning of regularization on coefficients. Keep the preprocessing step with the model so that deployment uses the same transformation.

Continue with the book

Explore the full treatment, worked examples, and exercises in Mathematics for AI and Machine Learning.


Companion article for Mathematics for AI and Machine Learning, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top