Why is feature scaling important for Logistic Regression, especially when regularization is applied?

Quick Overview

Asks why feature scaling matters for logistic regression, with and without a regularization penalty. It tests how coefficient size depends on feature units, how L1 and L2 penalties react to that, solver convergence, and leak-free preprocessing.

Why is feature scaling important for Logistic Regression, especially when regularization is applied?

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why is feature scaling important for logistic regression, especially when regularization is applied? Explain what changes with the penalty, what changes for the optimizer, and what stays the same when there is no penalty at all. ```hint Change the units Take one feature and convert it from days to years. Ask what its coefficient must do to keep the same predictions, and what that does to the penalty term. ``` ```hint Separate fit from optimization Without a penalty, decide whether rescaling changes the fitted probabilities or only the path the solver takes to reach them. ``` ### What a Strong Answer Covers - Why the penalty depends on the units of each feature, with the correct direction of the effect - What standardization changes for L2 and for L1 penalties - How feature scale affects gradient-based solvers and convergence - What stays the same in an unpenalized model - Fitting the scaler without leaking validation or test data ### Follow-up Questions - Should you standardize one-hot encoded features, and what changes if you do? - How does feature scale affect which features lasso keeps? - In an unregularized model, if you multiply one feature by 1,000, what happens to its coefficient, its standard error and the predictions? - Which common models do not need feature scaling, and why?

Overview: Asks why feature scaling matters for logistic regression, with and without a regularization penalty. It tests how coefficient size depends on feature units, how L1 and L2 penalties react to that, solver convergence, and leak-free preprocessing.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherMachine Learning
0
0

Why is feature scaling important for logistic regression, especially when regularization is applied? Explain what changes with the penalty, what changes for the optimizer, and what stays the same when there is no penalty at all.

What a Strong Answer Covers Guidance

  • Why the penalty depends on the units of each feature, with the correct direction of the effect
  • What standardization changes for L2 and for L1 penalties
  • How feature scale affects gradient-based solvers and convergence
  • What stays the same in an unpenalized model
  • Fitting the scaler without leaking validation or test data

Follow-up Questions Guidance

  • Should you standardize one-hot encoded features, and what changes if you do?
  • How does feature scale affect which features lasso keeps?
  • In an unregularized model, if you multiply one feature by 1,000, what happens to its coefficient, its standard error and the predictions?
  • Which common models do not need feature scaling, and why?