How does Ridge regression affect the weights of two perfectly collinear features?

Quick Overview

Asks how ridge regression assigns weights to two perfectly collinear features, including identical and scaled copies. Tests understanding of the L2 penalty, why least squares becomes non-unique, the effect of feature scaling, and how lasso and elastic net differ.

How does Ridge regression affect the weights of two perfectly collinear features?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How does Ridge regression affect the weights of two perfectly collinear features? Suppose one feature in a linear regression is an exact copy, or an exact multiple, of another. Explain what ridge regression does to the two weights and why. ```hint What the data pins down Write the fitted values in terms of the two weights. Find the combination of weights that the data determines, then ask what the L2 penalty prefers among all weights giving that same fit. ``` ### What a Strong Answer Covers - Why ordinary least squares has no unique solution here, and why ridge does - The split ridge chooses for identical copies, with a short derivation - How the split changes when one feature is a scaled copy of the other, and what that implies for preprocessing - What happens to the combined weight, including how duplication changes the effective penalty - How lasso and elastic net behave in the same setting ### Follow-up Questions - If you add a third identical copy, what happens to each weight and to the total? - The two features are highly correlated (say 0.95) but not identical. How does ridge behave, and how do coefficient variances compare with OLS? - Lasso picks one copy arbitrarily. How would you get stable feature selection with correlated features? - How would you explain feature importance to stakeholders when features are collinear?

Overview: Asks how ridge regression assigns weights to two perfectly collinear features, including identical and scaled copies. Tests understanding of the L2 penalty, why least squares becomes non-unique, the effect of feature scaling, and how lasso and elastic net differ.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How does Ridge regression affect the weights of two perfectly collinear features?

Suppose one feature in a linear regression is an exact copy, or an exact multiple, of another. Explain what ridge regression does to the two weights and why.

What a Strong Answer Covers Guidance

  • Why ordinary least squares has no unique solution here, and why ridge does
  • The split ridge chooses for identical copies, with a short derivation
  • How the split changes when one feature is a scaled copy of the other, and what that implies for preprocessing
  • What happens to the combined weight, including how duplication changes the effective penalty
  • How lasso and elastic net behave in the same setting

Follow-up Questions Guidance

  • If you add a third identical copy, what happens to each weight and to the total?
  • The two features are highly correlated (say 0.95) but not identical. How does ridge behave, and how do coefficient variances compare with OLS?
  • Lasso picks one copy arbitrarily. How would you get stable feature selection with correlated features?
  • How would you explain feature importance to stakeholders when features are collinear?