Why can ridge regression still produce a unique solution when p > n, whereas ordinary least squares fails?

Quick Overview

Asks why ridge regression has a single solution when there are more features than training examples while ordinary least squares does not. Tests the linear algebra behind regression: rank, null spaces, eigenvalues, strict convexity and the minimum-norm limit of the ridge estimate.

Why can ridge regression still produce a unique solution when p > n, whereas ordinary least squares fails?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why can ridge regression still produce a unique solution when $p > n$ (more features than training examples), whereas ordinary least squares fails? ```hint Look at the rank Work out the largest possible rank of $X^\top X$ when $X$ has fewer rows than columns, and what that means for its inverse. ``` ```hint Move along a direction Pick a nonzero vector $v$ with $Xv = 0$. Compare how the residual sum of squares and the ridge penalty change as you move a solution along $v$. ``` ### What a Strong Answer Covers - Why $X^\top X$ is singular when $p > n$ and what that does to the set of OLS minimizers - The role of the null space of $X$ - Why adding the ridge penalty leaves exactly one minimizer, argued through eigenvalues or strict convexity - The form of the ridge solution and its limit as $\lambda$ shrinks toward zero - The difference between a unique solution and a model that generalizes ### Follow-up Questions - Does the lasso also give a unique solution when $p > n$? - Gradient descent on plain least squares with $p > n$, started from all zeros: which of the many solutions does it reach? - Why should features be standardized before fitting ridge, and should the intercept be penalized? - When $p$ is much larger than $n$, which way of computing the ridge solution is cheaper?

Overview: Asks why ridge regression has a single solution when there are more features than training examples while ordinary least squares does not. Tests the linear algebra behind regression: rank, null spaces, eigenvalues, strict convexity and the minimum-norm limit of the ridge estimate.

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

Why can ridge regression still produce a unique solution when p>np > n (more features than training examples), whereas ordinary least squares fails?

What a Strong Answer Covers Guidance

  • Why X⊤XX^\top X is singular when p>np > n and what that does to the set of OLS minimizers
  • The role of the null space of XX
  • Why adding the ridge penalty leaves exactly one minimizer, argued through eigenvalues or strict convexity
  • The form of the ridge solution and its limit as λ\lambda shrinks toward zero
  • The difference between a unique solution and a model that generalizes

Follow-up Questions Guidance

  • Does the lasso also give a unique solution when p>np > n ?
  • Gradient descent on plain least squares with p>np > n , started from all zeros: which of the many solutions does it reach?
  • Why should features be standardized before fitting ridge, and should the intercept be penalized?
  • When pp is much larger than nn , which way of computing the ridge solution is cheaper?