Multiple Linear Regression
Multiple Linear Regression is used when we want to predict one numerical value using two or more input features.
Multiple inputs → one numerical prediction.
Instead of using only one feature, the model uses several features together to make a prediction.
Why Do We Need Multiple Features?
In real life, one factor is often not enough to predict something accurately.
For example, when predicting a house price, the price may depend on several things:
Example: 2,000 sq ft
Example: 3 bedrooms
Example: 5 years
These features can be used together to predict the house price.
Simple vs Multiple Linear Regression
House Size → House Price
Size + Bedrooms + Age → House Price
Both are used to predict a numerical value. The main difference is the number of input features.
A House Price Example
Suppose we have the following training data:
Here we have three input features:
How Does the Model Make a Prediction?
The model learns how each input feature contributes to the final prediction.
The model learns the relationship between all these features and the target value.
The Multiple Linear Regression Formula
With multiple input features, the equation becomes:
The idea is the same as Simple Linear Regression, but now there are multiple inputs.
You do not need to memorize this formula yet. The important thing is to understand that every input feature has a learned coefficient.
A Simple Numerical Example
Suppose the model has learned this equation:
Suppose we want to predict the price of this house:
Put these values into the equation:
The numbers above are only for understanding the concept. A real model would learn its coefficients from actual training data.
What Does Each Coefficient Mean?
Each feature gets a coefficient. The coefficient represents how the prediction changes when that feature changes, while the other features are held constant.
In this example, increasing size by one unit increases the model's predicted price by the coefficient amount, assuming the other inputs stay unchanged.
The model associates each additional bedroom with a +5 change in predicted price in this example, holding other features constant.
The negative coefficient means increasing age decreases the predicted price in this example, holding other features constant.
Making a New Prediction
After training, we can give the model information about a new house.
The model combines the information from all input features to produce one numerical prediction.
Another Real-World Example
House prices are only one example. Multiple Linear Regression can be useful whenever several numerical or appropriately encoded features are used to predict a numerical target.
TV advertising, online advertising, etc.
Historical sales information.
Numerical prediction.
Here, multiple inputs are used to predict one numerical value.
Simple vs Multiple Linear Regression
Study Hours → Exam Score
Size + Bedrooms + Age → House Price
Both are linear regression methods. The difference is how many input features are used.
Multiple Linear Regression = Multiple Inputs → One Numerical Output.
The model learns how several input features are related to a numerical target and combines those learned relationships to make predictions for new data.
Which One Is Multiple Linear Regression?
The second and third examples are Multiple Linear Regression because they use multiple input features to predict one numerical output.