Lesson 44 of 60
pythonFeature Scaling: Normalization and Standardization
20 minutes
Course progress73%
Feature Scaling
Many ML algorithms (e.g., K‑means, SVM) are sensitive to feature magnitude. Scaling brings features onto a comparable scale.
Normalization (min‑max scaling)
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaled = scaler.fit_transform(df[['price', 'quantity']])
scaled_df = pd.DataFrame(scaled, columns=[, ])