Menu
Advertisement
Advertisement
Advertisement

Lesson 1: Simple Linear Regression

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 (yiy^i)2\text{Minimize } \sum (y_i - \hat{y}_i)^2

Advertisement

All Chapters in this Book

Sponsored Content

finding (solutions) x

A public notebook and learning hub.