Feature scaling transforms input variables so their numerical magnitudes are comparable. This matters when interpreting linear models: a wide-ranging variable such as salary can dominate a narrower variable such as age, distorting the apparent importance of model weights. section 9.1.3
Use scaling to support fairer learning and interpretation:
- Place features in the same numerical range before training a robust linear model. section 9.1.3
- Interpret weights cautiously when features retain substantially different magnitudes. section 9.1.3
- Pair scaling with sparse linear models when comparing which features receive zero or nonzero weights. section 9.1.3
Breast-cancer diagnosis
A logistic-regression workflow loads breast-cancer data, applies StandardScaler to X, trains the model, and evaluates predictions. Scaling makes the learned feature weights more meaningfully comparable.




