Compute both the z-score standardised values (using population standard deviation) and the min-max scaled values on [0,1] for the feature vector [0,8,18,50]. What drawback of min-max scaling does this example reveal, and which ML algorithms do or do not require feature scaling?

Foundations, Feature engineering
Level L2 Elementary. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can compute both scalings by hand, diagnose outlier sensitivity, and distinguish scale-sensitive from scale-invariant models.

Key idea

Min-max scaling divides by max⁡−min⁡, so a single outlier crushes normal points into a narrow sub-interval; z-score standardisation centres to mean 0 and unit variance, though severe outliers still distort both μ and σ.

Steps

  1. Compute z-scores zi=(xi−μ)/σ: the mean is μ=(0+8+18+50)/4=19, and the squared deviations are (0−19)2+(8−19)2+(18−19)2+(50−19)2=361+121+1+961=1444, so σ=1444/4=361=19. Thus z=[−1,  −1119,  −119,  3119]≈[−1.00,  −0.58,  −0.05,  1.63].
  2. Compute min-max values x~i=(xi−xmin⁡)/(xmax⁡−xmin⁡) with xmin⁡=0 and xmax⁡=50: x~=[0,  850,  1850,  1]=[0.00,  0.16,  0.36,  1.00].
  3. Diagnose the drawback: the three regular values 0,8,18 are squeezed into [0,0.36] while the single outlier 50 claims nearly two-thirds of the range, and any future test point above 50 will map outside [0,1]. When outliers are severe, robust scaling (subtracting the median and dividing by the interquartile range) avoids this.
  4. Classify algorithms: distance-based, margin-based, variance-based and gradient-trained models (k-NN, RBF and linear SVMs, PCA, k-means, regularised linear/logistic regression, neural networks) depend on feature scale and usually need scaling; axis-aligned tree models (decision trees, random forests, gradient-boosted trees) are invariant to strictly monotone feature transformations and do not.

Common mistakes

How long your answer should be

Half a page; 3–4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Foundations: You fit two nested Gaussian regression models on n=100 data points: Model A has kA=3 parameters and maximised log-likelihood ℓA=−120, while Model B has kB=6 parameters and ℓB=−114. Using AIC=2k−2ℓ and BIC=kln⁡n−2ℓ (lower is better), which model does each criterion select?
Next in Foundations: For a d-dimensional input vector x∈Rd, a full polynomial expansion of degree at most p (including the constant bias term 1) has D=(d+pp) features. What is D when d=10 and p=3, and what happens to unregularised least-squares linear regression if you only have n=200 training examples?