AlgoPlus//machine learning / linear-regression
Read the theory

Linear Regression

Fit a line to data by minimizing the squared error with gradient descent.

Slope w
Intercept b
MSE
Legend
Fitted line
Data point
Residual
AI Tutor Workspace
In a nutshell
Linear regression draws the single straight line that best follows a cloud of points, so you can predict one quantity from another. 'Best' means the line with the smallest average squared vertical gap to the points; you find it either with an exact formula or by gradient descent, nudging the line downhill on that error.
Ready
Press play to begin the cinematic walkthrough.
Drop a stick on a cloud of points and rotate/shift it until the vertical gaps are as small as possible on average. That balance point is the least-squares line.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Linear Regression.