Linear regression fits one dependent variable with an intercept, a slope, and an error.
#linearregression #polynomialregression #leastsquares
Linear regression fits one dependent variable with an intercept, a slope, and an error. The intercept θ₀ is the bias. The slope θ₁ is how the prediction moves with x. The error ε is the vertical gap from a point to the line. Ordinary least squares is the straight line that makes the sum of those squared gaps as small as a line can. Polynomial regression keeps that fit and adds powers of x. With a square it is y = θ₀ + θ₁x + θ₂x² + ε, degree 2. A square is not straight in x, so the graph bends. The model stays linear in the coefficients, so the square is another column beside the constant and x, and the same minimization applies.
On a cloud that bows, the best line leaves a systematic error: the ends sit on one side and the middle sits on the other. An intercept and a slope cannot follow that bend. The new column takes the pattern, the long gaps shrink, and the squared error falls. Degree 2 is enough for one bow. A higher power can bend between the points and treat noise as shape.
If this animation helped, like, share, and save. Follow @theunderlyingcurve.
#linearregression #polynomialregression #leastsquares #machinelearning
Comments
Comments from the original post on Instagram
No comments yet
