Min-Max Normalization
What You'll Learn
You'll learn how to transform features into a fixed range—typically [0,1] or [-1,1]—using a simple mathematical formula that preserves relative distances.
The Core Idea
Min-Max Normalization (also called min-max scaling) squeezes all your feature values into a specific range by finding the minimum and maximum values, then rescaling everything proportionally between them.
The formula is straightforward:
X_scaled = (X - X_min) / (X_max - X_min)
This gives you values in the [0,1] range. For [-1,1], you multiply by 2 and subtract 1.
How It Works
Imagine you have exam scores ranging from 40 to 100. Min-max normalization:
- Finds the minimum (40) and maximum (100)
- Subtracts the minimum from each score: a score of 70 becomes 70 - 40 = 30
- Divides by the range (100 - 40 = 60): 30 / 60 = 0.5
So a score of 70 becomes 0.5 in the normalized scale, exactly halfway between 0 and 1.
Why This Matters
Remember from Feature Scaling for KNN and Feature Scaling for K-Means: algorithms that use distance calculations need features on similar scales. Min-max normalization ensures that a feature measuring temperature in Celsius (ranging 0–40) doesn't get drowned out by a feature measuring income (ranging 20,000–100,000).
Unlike standardization, min-max normalization guarantees your data fits within exact bounds—crucial when neural networks expect inputs in [0,1] or when you need guaranteed ranges for certain algorithms.
Key Takeaway: Min-max normalization rescales features to a fixed range by subtracting the minimum and dividing by the range, preserving relative distances while ensuring all features contribute equally to distance-based algorithms.