When is penalized logistic regression used?

Quick Overview

Asks when to fit logistic regression with an L1, L2 or elastic net penalty instead of plain maximum likelihood. Tests understanding of overfitting, separation, multicollinearity and high-dimensional data, and how the penalty strength is chosen.

When is penalized logistic regression used?

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

When is penalized logistic regression used? Describe the situations where you would add an L1, L2 or elastic net penalty to a logistic regression model instead of fitting it by plain maximum likelihood. ```hint Where maximum likelihood struggles Think about data sets where the unpenalized log-likelihood has no finite maximizer, or has one that moves a lot with small changes in the data. ``` ```hint Match the penalty to the problem Consider what an L1 penalty and an L2 penalty each do to the coefficients, and which of those situations each one addresses. ``` ### What a Strong Answer Covers - The data conditions under which unpenalized maximum likelihood overfits or fails to converge - What happens to the coefficients under complete or quasi-separation and why a penalty keeps them finite - How L1, L2 and elastic net differ and when each one fits - How the penalty strength is chosen - Practical details such as feature scaling and leaving the intercept unpenalized ### Follow-up Questions - Why do features need to be standardized before fitting a penalized logistic regression? - How does an L2 penalty relate to a Gaussian prior on the coefficients? - With L1 and a group of highly correlated features, which features get kept, and how does elastic net change that? - Firth's penalized likelihood is another fix for separation. How does it differ from a ridge penalty?

Overview: Asks when to fit logistic regression with an L1, L2 or elastic net penalty instead of plain maximum likelihood. Tests understanding of overfitting, separation, multicollinearity and high-dimensional data, and how the penalty strength is chosen.

General logo
General
Nov 25, 2026
mediumData ScientistOtherMachine Learning
0
0

When is penalized logistic regression used? Describe the situations where you would add an L1, L2 or elastic net penalty to a logistic regression model instead of fitting it by plain maximum likelihood.

What a Strong Answer Covers Guidance

  • The data conditions under which unpenalized maximum likelihood overfits or fails to converge
  • What happens to the coefficients under complete or quasi-separation and why a penalty keeps them finite
  • How L1, L2 and elastic net differ and when each one fits
  • How the penalty strength is chosen
  • Practical details such as feature scaling and leaving the intercept unpenalized

Follow-up Questions Guidance

  • Why do features need to be standardized before fitting a penalized logistic regression?
  • How does an L2 penalty relate to a Gaussian prior on the coefficients?
  • With L1 and a group of highly correlated features, which features get kept, and how does elastic net change that?
  • Firth's penalized likelihood is another fix for separation. How does it differ from a ridge penalty?