Curated · Ridge Regression

MSQ · 2 marks · Problem ML-REGU-0007

Ridge regression fits \(\hat{\mathbf w}_\lambda\) by minimising \(\lVert\mathbf y-X\mathbf w\rVert_2^2+\lambda\lVert\mathbf w\rVert_2^2\) with \(\lambda>0\) (no intercept). Which of the following statements is/are correct?
  1. A
    For every \(\lambda>0\), \(X^{\top}X+\lambda I\) is invertible, even when two columns of \(X\) are identical.
  2. B
    The training error \(\lVert\mathbf y-X\hat{\mathbf w}_\lambda\rVert_2^2\) never decreases as \(\lambda\) increases.
  3. C
    Rescaling one feature (for example, from metres to centimetres) leaves the ridge fitted values unchanged.
  4. D
    The squared norm \(\lVert\hat{\mathbf w}_\lambda\rVert_2^2\) increases as \(\lambda\) increases.

Solve it on GATE DA practice →More Supervised Learning — Regression problems

Show the worked solution\[\boxed{\hat{\mathbf w}_\lambda=(X^{\top}X+\lambda I)^{-1}X^{\top}\mathbf y}\](A) \(\mathbf v^{\top}(X^{\top}X+\lambda I)\mathbf v=\lVert X\mathbf v\rVert^2+\lambda\lVert\mathbf v\rVert^2>0\) for \(\mathbf v\neq\mathbf 0\), so the matrix is positive definite, whatever the columns — correct.(B) For \(\lambda_1<\lambda_2\), comparing each solution with the other in both objectives gives \(\lVert\hat{\mathbf w}_{\lambda_2}\rVert\le\lVert\hat{\mathbf w}_{\lambda_1}\rVert\) and then \(\text{RSS}(\lambda_1)\le\text{RSS}(\lambda_2)\): a larger penalty buys a smaller norm at the price of a worse fit — correct.(C) Unlike ordinary least squares, ridge is not scale-invariant: in centimetres the needed coefficient is \(100\) times smaller and so is penalised far less, which changes the fit. This is why features are standardised before ridge — incorrect.(D) The norm shrinks (weakly) as \(\lambda\) grows, as shown in (B) — incorrect.Answer: A, B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com