0% found this document useful (0 votes)
12 views30 pages

3.3 Regression Problem

Uploaded by

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

3.3 Regression Problem

Uploaded by

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

1 12/15/2024

Unit-III: Supervised Learning

R19CS302-Artificial Intelligence & Session by


Machine Learning Ms.Keerthika J, AP/CSE
2 12/15/2024

 Overview of Simple Linear Regression


 Problems
 Overview of Multiple Linear Regression
 Problems
3 12/15/2024

UNIT-III: SUPERVISED LEARNING


Introduction to Machine Learning-Types; Regression
Models: Linear Models for Regression, Common
Regression Algorithms: Simple Linear Regression,
Multiple Linear Regression, Bayesian linear
regression, Common Classification Algorithms: Naive
Bayes, Decision Trees – Random Forest model –Support
Vector Machines, Maximum margin classifier.
4 12/15/2024

Course Outcomes:
 CO1 (Apply-K3) Understand the intelligent agents and apply the various
search techniques to real-time problems
 CO2 (Apply-K3) Use automated reasoning techniques to real world
problems
 CO3(Apply-K3) Apply the concepts behind supervised learning and their
appropriateness
 CO4(Apply-K3) Apply and build the unsupervised learning algorithms to
various real-time data.
 CO5(Apply-K3) Apply the advanced learning techniques to various real
time data.
5 12/15/2024

Simple Linear Regression

Simple Linear Regression Analysis is the analysis of the linear relationship


between two quantitative continuous variables.
6 12/15/2024

Example :Plot the crop yield based on the amount of rainfall.


Here, rainfall is the independent variable and crop yield is the
dependent variable.
7 12/15/2024

Step 1: This is a graph with


Dataset the data plotted
X Y

1 2

2 4

3 5

4 4

5 5
8 12/15/2024

Next, we calculate the means, or average values, of x and y.


The average of the x values is 3, and the average of the y
values is 4.
9 12/15/2024

Compute regression line equation


10 12/15/2024

The calculated values are:


m = 0.6
c = 2.2
The linear equation is:
y = m*x + c
find out the predicted values of y for corresponding values
of x using the linear equation in which m = 0.6 and c = 2.2
and plot them.
11 12/15/2024

Find Ypred
12 12/15/2024

 the blue points represent the actual y values, and the brown
points represent the predicted y values based on the model
we created.
 The distances between the actual and predicted values are
known as residuals or errors.
 The best-fit line should have the lowest sum of squares of
these errors, also known as “e square.”
13 12/15/2024
14 12/15/2024

Find best fit line


 You can observe that the sum of squared errors for this
regression line is 2.4.
 We check this error for each line and determine the best-fit
line having the lowest e square value.
 The graphical representation is:
15 12/15/2024

Multiple Linear Regression


“Multiple linear regression is a mathematical technique that deploys
the relationship among multiple independent predictor variables and a
single dependent outcome variable.”.
For example,
Reviewing the health of a person to check how much blood
pressure goes up and down with a unit change in the body mass
index of that person, keeping other factors constant.
16 12/15/2024
17 12/15/2024

Find the best-fit line


 To find the best-fit line for each independent variable, multiple linear
regression calculates three things:
 The regression coefficients that lead to the smallest overall model
error.
 The t-statistic of the overall model.
 The associated p-value (how likely it is that the t-statistic would have
occurred by chance if the null hypothesis of no relationship between
the independent and dependent variables was true).
 It then calculates the t-statistic and p-value for each regression
coefficient in the model.
18 12/15/2024

Problems 2:
 Consider the example below where the mass, y (grams), of a
chemical is related to the time, x (seconds), for which the chemical
reaction has been taking place according to the table:
Time, x
5 7 12 16 20
(seconds)
Mass, y
40 120 180 210 240
(grams)

 Find the equation of the regression line.


19 12/15/2024

solution
20 12/15/2024

 Towork out the regression line


the following values need to be
calculated:
21 12/15/2024

The easiest way of calculating them is by using a table


22 12/15/2024
23 12/15/2024

Calculate b
24 12/15/2024

Calculate a
25 12/15/2024

Solution: The equation of the regression line is


26 12/15/2024

Problem 3: To see how students' reaction skills have improved


over a year, eight students took a reactions test at the start of
the year and at the end of the year. These are their scores:
27 12/15/2024

Solutions:
We know that the equation of the least squares regression line is
28 12/15/2024

To find a we need to first work out the mean of


x and y
29 12/15/2024

So the equation of our regression line is


30 12/15/2024

You might also like