Feature scaling transforms numerical features to comparable ranges so large-magnitude variables do not dominate distance calculations or model performance. It is especially important for k-means, which assigns points using Euclidean distance. section 8.2.1 section 8.2.2
A practical scaling workflow includes:
- Identify magnitude differences, such as binary app indicators alongside byte counts measured in thousands. section 8.2.1
- Apply StandardScaler so each feature has a mean of 0 and a standard deviation of 1. section 8.2.2
- Use the scaled data for distance-based clustering or as preparation for PCA. section 8.2.1 section 9.2.5
Scaling a feature with scikit-learn
Create a StandardScaler and fit-transform numerical columns such as bytes, std1, and count1. The transformed values become comparable, while the data distribution’s shape remains unchanged. section 8.2.2




