MACHINE LEARNING • LESSON 7

Multiple Linear Regression

Multiple Linear Regression is used when we want to predict one numerical value using two or more input features.

THE SIMPLEST DEFINITION

Multiple inputs → one numerical prediction.

Instead of using only one feature, the model uses several features together to make a prediction.

01

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:

FEATURE 1 House Size

Example: 2,000 sq ft

FEATURE 2 Bedrooms

Example: 3 bedrooms

FEATURE 3 Age of House

Example: 5 years

These features can be used together to predict the house price.

02

Simple vs Multiple Linear Regression

SIMPLE LINEAR REGRESSION One input feature

House Size → House Price

MULTIPLE LINEAR REGRESSION Multiple input features

Size + Bedrooms + Age → House Price

Both are used to predict a numerical value. The main difference is the number of input features.

03

A House Price Example

Suppose we have the following training data:

Size Bedrooms Age Price
1,000 sq ft 2 10 years ₹45 lakh
1,500 sq ft 3 8 years ₹65 lakh
2,000 sq ft 3 5 years ₹90 lakh
2,500 sq ft 4 3 years ₹115 lakh

Here we have three input features:

House Size
+
Bedrooms
+
House Age
House Price
04

How Does the Model Make a Prediction?

The model learns how each input feature contributes to the final prediction.

INPUT 1 Size
+
INPUT 2 Bedrooms
+
INPUT 3 Age
MODEL Predicted Price

The model learns the relationship between all these features and the target value.

05

The Multiple Linear Regression Formula

With multiple input features, the equation becomes:

ŷ = b₀ + b₁x₁ + b₂x₂ + b₃x₃

The idea is the same as Simple Linear Regression, but now there are multiple inputs.

ŷ Predicted value
b₀ Intercept
x₁ First feature
x₂ Second feature
x₃ Third feature
b₁, b₂, b₃ Learned coefficients

You do not need to memorize this formula yet. The important thing is to understand that every input feature has a learned coefficient.

06

A Simple Numerical Example

Suppose the model has learned this equation:

Price = 20 + 0.04 × Size + 5 × Bedrooms - 1 × Age

Suppose we want to predict the price of this house:

SIZE 2,000 sq ft
BEDROOMS 3
AGE 5 years

Put these values into the equation:

Price = 20 + (0.04 × 2000) + (5 × 3) - (1 × 5) Price = 20 + 80 + 15 - 5 Predicted Price = 110 lakh

The numbers above are only for understanding the concept. A real model would learn its coefficients from actual training data.

07

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.

SIZE +0.04

In this example, increasing size by one unit increases the model's predicted price by the coefficient amount, assuming the other inputs stay unchanged.

BEDROOMS +5

The model associates each additional bedroom with a +5 change in predicted price in this example, holding other features constant.

AGE -1

The negative coefficient means increasing age decreases the predicted price in this example, holding other features constant.

08

Making a New Prediction

After training, we can give the model information about a new house.

House Size = 1,800 sq ft
+
Bedrooms = 3
+
Age = 4 years
Multiple Linear Regression Model
Predicted House Price

The model combines the information from all input features to produce one numerical prediction.

09

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.

INPUT FEATURES Advertising Spend

TV advertising, online advertising, etc.

INPUT FEATURE Previous Sales

Historical sales information.

OUTPUT Future Sales

Numerical prediction.

Here, multiple inputs are used to predict one numerical value.

10

Simple vs Multiple Linear Regression

SIMPLE One feature

Study Hours → Exam Score

MULTIPLE Two or more features

Size + Bedrooms + Age → House Price

Both are linear regression methods. The difference is how many input features are used.

REMEMBER THIS

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.

QUICK CHECK

Which One Is Multiple Linear Regression?

Study Hours → Exam Score One input feature
Size + Bedrooms → House Price Multiple input features
Advertising + Previous Sales → Future Sales Multiple input features
Answer

The second and third examples are Multiple Linear Regression because they use multiple input features to predict one numerical output.

NEXT TOPIC

Understanding the Line

Next, we will understand what the regression line actually represents and how slope and intercept affect predictions.