0% found this document useful (0 votes)
24 views25 pages

1 Linear Regression

The document describes using simple linear regression and gradient descent to predict house prices based on area size. It shows housing data with area in square meters and selling price in lacs for different properties. It outlines the linear regression equation and gradient descent algorithm to find the coefficients that minimize cost. Gradient descent is an iterative method to optimize the coefficients by taking steps in the negative gradient direction.

Uploaded by

Smit
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)
24 views25 pages

1 Linear Regression

The document describes using simple linear regression and gradient descent to predict house prices based on area size. It shows housing data with area in square meters and selling price in lacs for different properties. It outlines the linear regression equation and gradient descent algorithm to find the coefficients that minimize cost. Gradient descent is an iterative method to optimize the coefficients by taking steps in the negative gradient direction.

Uploaded by

Smit
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/ 25

Simple Linear Regression

House Price Prediction

Area (SQM) Selling Price (Lacs)


35 13
37 17
39 15
40 16
43 18
48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
100 60
House Price Prediction

Area (SQM) Selling Price (Lacs)


35 13
37 17
39 15
40 16
43 18
48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
100 60
House Price Prediction

Area (SQM) Selling Price (Lacs)


35 13
37 17
39 15
40 16
43 18
48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
100 60
House Price Prediction

Area (SQM) Selling Price (Lacs)


35 13
37 17
39 15
40 16
43 18
48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
100 60
House Price Prediction

Area (SQM) Selling Price (Lacs)


35 13
37 17
39 15
40 16
43 18
48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
100 60
House Price Prediction
   Mathematically:
 =

OR

OR

OR
X y Ŷ (=0) Ŷ (=1) Ŷ (=2 Ŷ (=3

1 2 0 1 2 3

2 5 0 2 4 6

3 5 0 3 6 9

5 11 0 5 10 15

6 11 0 6 12 18
House Price Prediction
 Mathematically:

𝐽  ( 𝜃1 )

at local optima

Current value of
House Price Prediction
 Mathematically:
If α is too small, gradient descent
can be slow.

If α is too large, gradient descent


can overshoot the minimum. It may
fail to converge, or even diverge.
House Price Prediction
 Gradient Descent Algorithm
House Price Prediction
 Gradient Descent Algorithm

Correct: Simultaneous update Incorrect:

=
House Price Prediction
 Gradient Descent Algorithm

Gradient descent algorithm Linear Regression Model


House Price Prediction
 Gradient Descent Algorithm
Selling
Area
Price
(SQM)
(Lacs)
35 13
37 17
update 39 15
40 16
and 43 18
simultaneously 48 19
50 20
55 25
60 35
65 37
70 38
75 40
80 43
85 44
90 50
95 54
=
100 60

 If = 1 and = 0.5 ?


“Batch” Gradient Descent

“Batch”: Each step of gradient descent


uses all the training examples.

Andrew Ng
References
 Andrew Ng’s slides on Linear Regression from his
Machine Learning Course on Coursera.
Disclaimer
 Content of this presentation is not original and it
has been prepared from various sources for
teaching purpose.
Solve the regression problem and
calculate the coeffiient

You might also like