# Linear regression objective and gradient

> ML preparation item.

- Stable ID: `original-ml-regression`
- Area: Machine Learning
- Topic: Regression
- Origin: original
- Expected time: 8 minutes
- Skills: linear-regression, squared-loss, regression-gradient, normal-equations
- Item JSON: https://mlprep.iwase.dev/data/items/original-ml-regression.json

## Problem

For $X=\begin{bmatrix}1&0\\1&1\end{bmatrix}$, $\mathbf{y}=(1,3)$, and $\mathbf{w}=(0,0)$, use

$$L(\mathbf{w})=\frac{1}{2}\lVert X\mathbf{w}-\mathbf{y}\rVert_2^2.$$

Compute $L$, its gradient, and one gradient-descent update with learning rate $0.1$.


## Answer policy

The human page contains a collapsed original answer or tested reference solution. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `original-ml-regression`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
