Linear regression objective and gradient

Problem

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

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

Compute LL, its gradient, and one gradient-descent update with learning rate 0.10.1.

Reveal answer or reference solution

L=5L=5. The gradient is

wL=X(Xwy)=(4,3),\nabla_{\mathbf{w}}L=X^\top(X\mathbf{w}-\mathbf{y})=(-4,-3),

so the update is w=(0.4,0.3)\mathbf{w}=(0.4,0.3).

Local history

Loading attempts saved in this browser…

    Use with your agent

    Share this URL and your attempt. Ask the agent to start with a clarifying question or the smallest useful hint.

    Tutor me on https://mlprep.iwase.dev/item/original-ml-regression/. If window.mlPrepAgent is available, read attempts for item original-ml-regression before tutoring. Inspect my attempt, keep the item ID, and do not reveal the full answer first. After a real attempt, append its record with recorded_by agent, include agent_session_id when available, and read it back.

    Appears in