Menu
Advertisement
Advertisement

Lesson 1: Simple Linear Regression

Advertisement

Simple Linear Regression

Regression is about finding the “best fit” line through a scatter of data points.

The Model

We assume a linear relationship between an independent variable (xx) and a dependent variable (yy).

y=β0+β1x+ϵy = \beta_0 + \beta_1 x + \epsilon

  • yy: Dependent Variable (Target)
  • xx: Independent Variable (Feature)
  • β0\beta_0: Intercept
  • β1\beta_1: Slope (Coefficient)
  • ϵ\epsilon: Error term (Residual)

Visualizing the Fit

Imagine we are predicting House Price based on Size.

X ♠

Size

The input variable.

(Square Feet)

X ♠
Feature
Y ♥

Price

The output variable.

($$$)

Y ♥
Target

Least Squares Method

How do we find the “best” line? We minimize the sum of the squared differences (residuals) between the actual data points and the predicted line.

Minimize ∑(yi−y^i)2\text{Minimize } \sum (y_i - \hat{y}_i)^2

Advertisement

All Chapters in this Book

Sponsored Content
VOL. I, NO. 1 Thursday, February 5, 2026 PRICE: YOUR ATTENTION

finding (solutions) x

A public notebook and learning hub.