MACHINE LEARNING • LESSON 7

What Is Regression?

Regression is a type of machine learning problem where the goal is to predict a numerical value.

THE SIMPLEST DEFINITION

Regression predicts a number.

If the answer we want to predict is a numerical value, such as price, salary, temperature, sales, or house size, we are dealing with a regression problem.

01

What Does Regression Predict?

Regression predicts a value that can take different numerical values.

HOUSE PRICE ₹75,00,000

Predict the price of a house.

SALARY ₹8,50,000

Predict a person's salary.

SALES 15,000 units

Predict future sales.

In all these examples, the output is a number.

02

A Simple House Price Example

Imagine that we have information about several houses.

House Size Price
1,000 sq ft ₹50 lakh
1,500 sq ft ₹70 lakh
2,000 sq ft ₹90 lakh
2,500 sq ft ₹110 lakh

We want the machine learning model to learn the relationship between house size and house price.

INPUT House Size
MODEL Learns Relationship
OUTPUT House Price
03

Regression With a New House

Now suppose we have a new house:

NEW HOUSE 1,800 sq ft

The model uses what it learned from the previous houses to estimate the price.

INPUT 1,800 sq ft
REGRESSION MODEL Learned relationship
PREDICTION ₹82 lakh

The ₹82 lakh value is only an example. A real model would calculate its own prediction from the training data.

04

Regression Finds a Relationship

Regression does not simply memorize one answer for every input. It tries to learn a relationship between the input features and the numerical output.

In our house example:

House Size Input
Relationship Learned from data
House Price Numerical output

The model uses this learned relationship to make predictions for new examples.

::contentReference[oaicite:0]{index=0}
05

Regression Is About Numerical Output

The easiest way to recognize a regression problem is to look at what you want the model to predict.

REGRESSION Predict a number

Example: ₹75 lakh

CLASSIFICATION Predict a category

Example: Spam / Not Spam

This difference is extremely important.

06

Two Real-World Examples

EXAMPLE 1 Predict House Price

Inputs: house size, bedrooms, location

Output: ₹85 lakh

→ Regression
EXAMPLE 2 Predict Monthly Sales

Inputs: advertising, previous sales, season

Output: 12,500 units

→ Regression
07

Regression Does Not Mean Perfect Prediction

A regression model usually does not know the exact future. It makes an estimate based on patterns learned from the training data.

For example, if the actual house price is:

ACTUAL PRICE ₹85 lakh
MODEL PREDICTION ₹82 lakh
DIFFERENCE ₹3 lakh

The difference between the actual value and predicted value is part of what we later use to evaluate the regression model.

We will study this properly in the final topic of this lesson: Evaluate a Regression Model.

REMEMBER THIS

Regression = Predicting a Numerical Value.

Give the model input features, let it learn the relationship between those features and a numerical target, and then use that learned relationship to predict a value for new data.

QUICK CHECK

Is This Regression?

Predict house price ₹90 lakh
Predict tomorrow's temperature 32°C
Predict whether an email is spam Spam / Not Spam
Answer

House price and temperature are regression problems because their outputs are numerical values. Spam detection is classification because its output is a category.

NEXT TOPIC

What Is Linear Regression?

Now that we understand regression, the next step is to understand one of the simplest regression algorithms: Linear Regression.