Feature Scaling

Putting features on a comparable scale with StandardScaler or MinMaxScaler, so that a feature measured in large units does not dominate the others.

When to use

Scale before distance-based methods (KNN, K-Means) and before logistic regression or regularised regression (Ridge, Lasso); plain OLS predictions do not change with scaling. Fit the scaler on the training data only, ideally inside a Scikit-Learn Pipeline.

See DS Lec 3.

Appears in