0% found this document useful (0 votes)
84 views4 pages

1.1.1 Simple Linear Regression

Simple linear regression is a type of regression analysis where there is a linear relationship between one independent variable (X) and one dependent variable (Y). The goal is to create a model that can predict the value of Y based on the value of X. A simple example would be using variables like house size and location (X) to predict house prices (Y). The model learns parameters like the slope and intercept from historical data to estimate the "line of best fit." It can then make predictions on new data by using the line of best fit equation. Model performance is evaluated using error metrics like mean squared error or the coefficient of determination (R2).

Uploaded by

Dattatray Bankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views4 pages

1.1.1 Simple Linear Regression

Simple linear regression is a type of regression analysis where there is a linear relationship between one independent variable (X) and one dependent variable (Y). The goal is to create a model that can predict the value of Y based on the value of X. A simple example would be using variables like house size and location (X) to predict house prices (Y). The model learns parameters like the slope and intercept from historical data to estimate the "line of best fit." It can then make predictions on new data by using the line of best fit equation. Model performance is evaluated using error metrics like mean squared error or the coefficient of determination (R2).

Uploaded by

Dattatray Bankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.1.

Simple Linear Regression


What is Regression Problem?
Any regression algorithm works by feeding the machine sample data with various features
(represented as “𝑋”) and a continuous or numeric value output (represented as “𝑦”).
For instance, to predict the market rate for the purchase of a used car, a regression problem can be
formulated to predict selling price of a used car by analyzing the relationship between car attributes
(including the year of make, car brand, mileage, etc.) and the selling price of other cars sold based on
historical data.

After the machine deciphers the parameter values from the data, it creates what is known as a model:
an algorithmic equation for producing an outcome with new data based on the rules derived from the
training data.
Once the model is prepared, it can be applied to new data and tested for accuracy. After the model
has passed both the training and test data stages, it is ready to be applied and used in the real world.
Another simple example is to create a model for predicting house values where 𝑦 is the actual house
price and 𝑋 are the variables that impact 𝑦, such as land size, location, and the number of rooms.
Through supervised learning, we can create a rule to predict 𝑦 (house value) based on the given
values of various variables (𝑋).
There are many types of Regression such Simple Linear Regression, Multiple Linear Regression,
Polynomial Regression etc.
Simple Linear Regression
Simple linear regression is a type of regression analysis where the number of independent variables
is one and there is a linear relationship between the independent (𝑋) and dependent (𝑌) variable.

Independent variable, denoted by (𝑋) is also known as the predictor, explanatory variable

Dependent variable, denoted by (𝑌), is also known as the response, outcome, or target variable.

Simple linear regression gets its adjective "simple," because it concerns the study of only one
predictor variable. In contrast, multiple linear regression, which we study later in this course, gets its
adjective "multiple," because it concerns the study of two or more predictor variables.

Simple linear regression uses traditional slope-intercept form,

𝒚 = 𝒃𝟎 + 𝒃𝟏 𝒙

where 𝑏0 (the intercept) and 𝑏1 (the slope) are the parameters our algorithm will try to “learn” to
produce the most accurate predictions.
Example:
Let's consider a scenario where we want to determine the linear relationship between: How much a
company spends on Radio advertising each year and its annual Sales in terms of units sold. We are
trying to develop an equation that will let us to predict units sold based on how much a company
spends on radio advertising. Given Below is a screenshot of dataset
radio sales
37.8 22.1
39.3 10.4
45.9 9.3
41.3 18.5
10.8 12.9
48.9 7.2
32.8 11.8
A Simple Linear Regression model can be formulated between sales (dependent variable) & radio
(independent variable)

𝒔𝒂𝒍𝒆𝒔 = 𝒃𝟎 + 𝒃𝟏 ∗ 𝒓𝒂𝒅𝒊𝒐

Our algorithm will try to learn the correct values for 𝒃𝟎 and 𝒃𝟏 using:

By the end of our training we get:


the intercept 𝑏0 = 9.31 and the slope 𝑏1 = 0.2
And now our equation:
𝒔𝒂𝒍𝒆𝒔 = 𝟗. 𝟑𝟏 + 𝟎. 𝟐 ∗ 𝒓𝒂𝒅𝒊𝒐
will approximate the line of best fit.
Our prediction model can now output an estimate of sales given a new value of company’s radio
advertising expenditure. For example, if the company spends $ 50 on radio advertisement then it can
expect an average sale of:

𝟗. 𝟑𝟏 + 𝟎. 𝟐 ∗ 𝟓𝟎 = 𝟏𝟗. 𝟑𝟏 𝒖𝒏𝒊𝒕𝒔 ~ 𝟏𝟗 𝒖𝒏𝒊𝒕𝒔

To evaluate model performance, we can use any of the following error metric:

Or coefficient of determination i.e., 𝑹𝟐

You might also like