Regression
Classica&on
Machine
Learning
Classica(on
Andrew
Ng
(Yes)
1
Malignant ?
(No)
0
Tumor
Size
Tumor
Size
Logis&c Regression:
Andrew
Ng
Logis&c
Regression
Hypothesis
Representa&on
Machine
Learning
Logis(c
Regression
Model
Want
0.5
Sigmoid func&on 0
Logis&c
func&on
Andrew
Ng
Interpreta(on
of
Hypothesis
Output
=
es&mated
probability
that
y
=
1
on
input
x
Example: If
Andrew
Ng
Logis&c
Regression
Decision
boundary
Machine
Learning
Logis(c
regression
1
z
Suppose
predict
if
predict if
Andrew
Ng
Decision
Boundary
x2
3
2
1 2 3 x1
Predict if
Andrew
Ng
Nonlinear
decision
boundaries
x2
1 1 x1
Predict
if
1
x2
x1
Andrew
Ng
Logis&c
Regression
Cost
func&on
Machine
Learning
Training
set:
m
examples
nonconvex convex
Andrew
Ng
Logis(c
regression
cost
func(on
If y = 1
0
1
Andrew
Ng
Logis(c
regression
cost
func(on
If y = 0
0
1
Andrew
Ng
Logis&c
Regression
Simplied
cost
func&on
and
gradient
descent
Machine
Learning
Logis(c
regression
cost
func(on
Andrew
Ng
Logis(c
regression
cost
func(on
To t parameters :
Andrew
Ng
Gradient
Descent
Want
:
Repeat
Andrew
Ng
Gradient
Descent
Want
:
Repeat
Gradient
descent:
Repeat
Andrew
Ng
Op(miza(on
algorithm
Given
,
we
have
code
that
can
compute


(for
)
Andrew
Ng
theta =
Machine
Learning
Mul(class
classica(on
Email
foldering/tagging:
Work,
Friends,
Family,
Hobby
Andrew
Ng
Binary
classica&on:
Mul&class
classica&on:
x2 x2
x1
x1
Andrew
Ng
x2
Onevsall
(onevsrest):
x1
x2
x2
x1
x1
x2
Class
1:
Class
2:
Class
3:
x1
Andrew
Ng
Onevsall
Andrew Ng