Address Overfitting with L1 Regularization in Regression

Quick Overview

Evaluates overfitting risk in high-dimensional linear regression and how L1 regularization mitigates it. Strong answers explain high variance, multicollinearity, Lasso shrinkage, feature selection, and validation.

Address Overfitting with L1 Regularization in Regression

Company: Google

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Technical Screen

##### Scenario You fit a linear regression with 500 predictors but only 600 observations. ##### Question a) What issue is likely to occur? b) Why does it happen? c) Explain how L1 regularization can mitigate it. ##### Hints Think over-fitting and coefficient shrinkage.

Quick Answer: Evaluates overfitting risk in high-dimensional linear regression and how L1 regularization mitigates it. Strong answers explain high variance, multicollinearity, Lasso shrinkage, feature selection, and validation.

|Home/Machine Learning/Google
Google logo
Google
Jul 12, 2025, 6:59 PM
mediumData ScientistTechnical ScreenMachine Learning
11
0

Linear Regression with Many Predictors and Few Observations

You fit an ordinary least squares linear regression with 500 predictors and 600 observations.

Answer the questions below and explain the role of L1 regularization.

Constraints & Assumptions

  • Assume predictors may be correlated and many may be weak or irrelevant.
  • Discuss generalization, not only training error.
  • Explain L1 regularization conceptually and mathematically enough for an interview.
  • Mention validation and feature scaling where relevant.

Clarifying Questions to Ask Guidance

  • Are the predictors standardized?
  • Are there known groups of correlated features?
  • What is the goal: prediction, inference, feature selection, or explanation?
  • Is there a separate validation or test set?

Part 1 - Likely Issue

What issue is likely to occur with 500 predictors and 600 observations?

What This Part Should Cover Guidance

  • Identify overfitting, high variance, unstable coefficients, and sensitivity to noise.
  • Explain that training error can look good while validation performance suffers.
  • Mention multicollinearity and near-singular design matrices.

Part 2 - Why It Happens

Why does this problem happen?

What This Part Should Cover Guidance

  • Relate model capacity and degrees of freedom to limited sample size.
  • Explain how correlated predictors make coefficient estimates unstable.
  • Explain why OLS has no penalty for coefficient complexity.

Part 3 - L1 Regularization

How can L1 regularization, or Lasso, mitigate the issue?

What This Part Should Cover Guidance

  • Add an L1 penalty to the loss function to shrink coefficients.
  • Explain that L1 can set some coefficients exactly to zero, performing feature selection.
  • Choose the regularization strength with cross-validation.
  • Discuss trade-offs: bias introduced, correlated feature instability, and need for scaling.

Follow-up Questions Guidance

  • How does L1 differ from L2 regularization?
  • What happens if two highly correlated predictors are both useful?
  • How would you evaluate whether regularization improved the model?
Loading comments...