0% found this document useful (0 votes)
2 views

04 Linear Regression

The document discusses linear regression as a type of machine learning model, focusing on how to compute outputs from given inputs and corresponding labels. It explains the cost function, specifically the mean square error, and introduces gradient descent as a method for optimizing the parameters of the model. Additionally, it provides examples of iterations using gradient descent to illustrate the implementation process.

Uploaded by

david1milad1982
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)
2 views

04 Linear Regression

The document discusses linear regression as a type of machine learning model, focusing on how to compute outputs from given inputs and corresponding labels. It explains the cost function, specifically the mean square error, and introduces gradient descent as a method for optimizing the parameters of the model. Additionally, it provides examples of iterations using gradient descent to illustrate the implementation process.

Uploaded by

david1milad1982
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/ 53

Linear Regression

Types of ML models
Regression

 Initially Given:
Given an input 𝑿 we
– Data X = x (1) , . . . , x (n ) Then
would like to compute
an output 𝒀
– Corresponding labels y = y (1) , . . . , y( n )
9
8
September Arctic Sea Ice Extent

7
(1,000,000 sq km)

6
5
4
Linear Regression
3
Quadratic Regression
2
1
0
1975 1980 1985 1990 1995 2000 2005 2010 2015
Year
Types of Regression models
How to calculate error value

Cost function = Error function = Mean square error


Linear Regression
Intuition Behind Cost Function
Intuition Behind Cost Function

(for fixed , this is a function of x) (function of the parameters )


Intuition Behind Cost Function

(for fixed , this is a function of x) (function of the parameters )


Intuition Behind Cost Function

(for fixed , this is a function of x) (function of the parameters )


Intuition Behind Cost Function

(for fixed , this is a function of x) (function of the parameters )


Solution to calculate the values of theta 0 and
theta 1 automatic using Gradient Descent
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )

h(x) = -900 – 0.1 x


Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Gradient Descent
(for fixed , this is a function of x) (function of the parameters )
Summary
Summary
Summary
Example after implementing some
iterations using Gradient descent
Iteration 1
Iteration 2
Iteration 10
Example
Example
Example
Example
Example
Example

You might also like