Z-score normalization rescales each feature by subtracting its mean from every value and dividing by that feature’s standard deviation. The result has zero mean and unit variance, preventing large-unit features from dominating distance calculations. section 12.5
Apply the transformation independently to each feature:
- Compute the feature’s mean and standard deviation. section 12.5
- Subtract the mean from every feature value. section 12.5
- Divide each centered value by the feature’s standard deviation before measuring similarity. section 12.5
Customer clustering
Annual salaries around $100K–$200K and monthly expenses around $500–$1,000 have very different scales. Without normalization, salary differences can overwhelm expense differences when Euclidean distance assigns customers to clusters. section 12.5
Figure 12.24 A synthetic dataset showing customers of a hypothetic e-commerce website after feature scaling. On the right, a possible (bad) clustering for the dataset.
View the synthetic customer dataset after feature scaling and compare it with the resulting clustering context. section 12.5

