Curated · Multiple Linear Regression

NAT · 2 marks · Problem ML-REGR-0002

An ordinary least-squares (OLS) linear regression model with an intercept is fitted to a dataset of four observations. The vector of observed target values is \(\mathbf{y} = [5, 1, 3, 7]^T\), and the corresponding vector of predicted values is \(\hat{\mathbf{y}} = [6, 2, 2, 6]^T\). The coefficient of determination \(R^2\) of the fitted model is .

Numerical answer (NAT).

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

Show the worked solutionThe coefficient of determination is:\[ R^2 = 1 - \frac{\text{RSS}}{\text{TSS}} \]Given the mean \(\bar{y} = \frac{5+1+3+7}{4} = 4\), the Total Sum of Squares (TSS) is:\[ \text{TSS} = \sum_{i=1}^4 (y_i - \bar{y})^2 = (1)^2 + (-3)^2 + (-1)^2 + (3)^2 = 20 \]With residual vector \(\mathbf{e} = \mathbf{y} - \hat{\mathbf{y}} = [-1, -1, 1, 1]^T\), the Residual Sum of Squares (RSS) is:\[ \text{RSS} = \sum_{i=1}^4 e_i^2 = (-1)^2 + (-1)^2 + (1)^2 + (1)^2 = 4 \]Hence, the coefficient of determination is:\[ R^2 = 1 - \frac{4}{20} = 1 - 0.2 = 0.8 \]Answer: 0.8

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