Professional Documents
Culture Documents
Machine Learning Lecture2 PDF
Machine Learning Lecture2 PDF
regression
with
one
variable
Model
representa6on
Machine
Learning
Andrew Ng
Housing
Prices
(Portland,
OR)
500
400
300
Price
200
(in
1000s
100
of
dollars)
0
0
500
1000
1500
2000
2500
3000
Size
(feet2)
Supervised
Learning
Regression Problem
Andrew Ng
Training
set
of
housing
prices
(Portland,
OR)
Nota6on:
m
=
Number
of
training
examples
xs
=
input
variable
/
features
ys
=
output
variable
/
target
variable
Andrew Ng
How do we represent h ?
Training Set
Learning
Algorithm
Size
of
house
Es6mated
price
Linear
regression
with
one
variable.
Univariate
linear
regression.
Andrew Ng
Linear
regression
with
one
variable
Cost
func6on
Machine
Learning
Andrew Ng
Training Set
Hypothesis:
s:
Parameters
How
to
choose
s
?
Andrew Ng
Andrew Ng
Andrew Ng
Linear
regression
with
one
variable
Cost
func6on
intui6on
I
Machine
Learning
Andrew Ng
Hypothesis:
Simplied
Parameters:
Cost
Func6on:
Goal:
Andrew Ng
0
0
0
-0.5
0
0.5
1
1.5
2
2.5
Andrew Ng
0
0
0
-0.5
0
0.5
1
1.5
2
2.5
Andrew Ng
0
0
0
-0.5
0
0.5
1
1.5
2
2.5
Andrew Ng
Linear
regression
with
one
variable
Cost
func6on
intui6on
II
Machine
Learning
Andrew Ng
Hypothesis:
Parameters:
Cost
Func6on:
Goal:
Andrew Ng
500
400
1000
2000
3000
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Linear
regression
with
one
variable
Machine Learning
Gradient
descent
Andrew Ng
Andrew Ng
J(0,1)
1
0
Andrew Ng
J(0,1)
1
0
Andrew Ng
Incorrect:
Andrew Ng
Linear
regression
with
one
variable
Gradient
descent
intui6on
Machine
Learning
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
at
local
op6ma
Current
value
of
Andrew Ng
As
we
approach
a
local
minimum,
gradient
descent
will
automa6cally
take
smaller
steps.
So,
no
need
to
decrease
over
6me.
Andrew Ng
Linear
regression
with
one
variable
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
J(0,1)
1
0
Andrew Ng
J(0,1)
1
0
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng