Feature Scaling: Min-Max Normalization
Min-Max Normalization rescales numeric features to a fixed range (typically [0, 1]) by mapping the minimum to 0 and the maximum to 1. This ensures that no single feature dominates due to scale differences, which is critical for distance-based and gradient-based algorithms.
The Min-Max Formula
For each value x in a feature column: x' = (x − x_min) / (x_max − x_min). The result is always in [0, 1], preserving the shape of the distribution while compressing its range.
Applying MinMaxScaler
When to Use Min-Max vs Standardization
Min-Max normalization is preferred when the data has a bounded range or when the algorithm expects inputs in [0, 1] (e.g., neural networks with sigmoid activations, image pixel values). It is sensitive to outliers, which can crush most values near zero or one.
Sensitivity to Outliers
A single outlier at 1,000,000 in an otherwise [0, 100] feature will compress all normal values to near zero after scaling. Apply outlier treatment (capping or removal) before min-max scaling, or use RobustScaler which uses percentiles instead of extremes.