Drag points · tap empty space to add one
The model predicts ŷ = m x + c. Its error is the mean squared error:
Gradient descent takes small steps downhill on this cost surface:
Least squares solves for the bottom of the valley in one go.
Link this to the Class 11 line of best fit: least squares and gradient descent reach the same line, by two very different routes.
Ask: “Why does the dot zig-zag across the valley instead of rolling straight down?” (The valley is long and narrow because x and 1 have very different sizes.)
A free coding & ai simulation for Class 9–12.