BIZNIQUE / LINEAR ALGEBRA / 11
Put feature scales in context
Put feature scales in context
See how units can dominate a distance even when neither feature is more meaningful.
BIZNIQUE / LINEAR ALGEBRA / 11
See how units can dominate a distance even when neither feature is more meaningful.
THE IDEA
Standardisation subtracts a training-set mean and divides by a training-set standard deviation. It changes the geometry seen by distance-sensitive models and can improve the conditioning of an optimisation problem.
zⱼ = (xⱼ − μⱼ) / sⱼ
Fit scaling parameters on training data only. Handle constant columns explicitly; dividing by a zero standard deviation is undefined.
TRY IT YOURSELF
If a training feature has mean 10 and standard deviation 2, what is the standardised value of 14?
(14 − 10)/2 = 2.