aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 6. Linear Regression
Lesson 4 of 9 10 min · 118 words

The closed-form solution

The normal equation and when it is practical.

Setting the gradient of to zero gives — the normal equations — and, if is invertible:

This gives the exact optimum in one step, with no learning rate or iterations. The cost is forming and solving a system, roughly . That is instant for tens or hundreds of features but impractical for hundreds of thousands.

is singular when features are perfectly collinear or when . Then there are infinitely many solutions; ridge regression's or the pseudo-inverse fixes it. Numerically, libraries use QR or SVD decompositions rather than computing the inverse directly.

Formula to remember

MSE gradient

Used for gradient-descent training.

Quick check · +5 XP

For true values [3, 5, 7] and predictions [2, 5, 9], the MAE is…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser