What is gradient of MSE loss in Linear Regression?

Updated May 16, 2026

Short answer

The gradient is proportional to Xᵀ(Xβ − y).

Deep explanation

For MSE = (1/n)||Xβ − y||², derivative w.r.t β gives gradient = (2/n)Xᵀ(Xβ − y). This direction shows how coefficients must change to reduce prediction error.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Linear Regression interview questions

View all →