A z-score expresses a value as its distance from a column mean in standard deviations. It puts differently scaled continuous variables on a comparable scale, preventing a high-variation feature from dominating distance-based clustering. section 13.1.4
Use z-score scaling when preparing continuous features for clustering:
- Scale continuous variables such as number of apps, number of sessions, and average session length. section 13.1.4
- Leave binary indicator columns unchanged because they are already on a comparable scale. section 13.1.4
- Interpret a value of 1 as one standard deviation above that variable’s mean; scaled values are approximately between −5 and 5. section 13.1.4
Scaling selected user features
Create a StandardScaler, copy the feature table, and replace only the continuous columns with their z-scores before clustering.







