What is the equation of a linear regression model?
The equation of a linear regression model represents the target as a weighted combination of the input features plus an intercept.
Simple linear regression
With one input feature, the prediction equation is:
ŷ = b0 + b1xwhere:
ŷis the predicted target valueb0is the interceptb1is the coefficient or slopexis the input feature
Multiple linear regression
With several input features, the equation becomes:
ŷ = b0 + b1x1 + b2x2 + ... + bnxnEach feature has its own coefficient.
For example:
Predicted Price
= Intercept
+ b1 × House Size
+ b2 × Number of Rooms
+ b3 × Distance from City CenterWhat does the intercept do?
The intercept b0 is the model's predicted value when all input features are zero.
Whether that value has a practical interpretation depends on the problem.
What do the coefficients do?
Each coefficient controls how much the prediction changes when its corresponding feature changes by one unit, while the other included features are held constant.
For example:
ŷ = 10 + 4xIf x increases by 1, the predicted value increases by 4.
Statistical form of the model
When describing the observed target rather than only the prediction, linear regression is often written as:
y = b0 + b1x1 + b2x2 + ... + bnxn + εHere, ε represents the error term: the part of the observed target that is not explained by the linear relationship.
Prediction form vs observed-value form
- Prediction equation: uses
ŷand does not include the unknown error term. - Statistical model equation: uses
yand includesεto represent unexplained variation.
Why is the model called linear?
The prediction is a linear combination of the coefficients and input features:
intercept + weighted feature 1 + weighted feature 2 + ...In short, a linear regression model predicts a numerical target by adding an intercept to the weighted sum of its input features.
Learning Sequence
Machine Learning Curriculum
Explore Related Questions
Deepen your understanding across related Machine Learning topics.