Professional Documents
Culture Documents
Lec5-Logistic (Regression) Classification
Lec5-Logistic (Regression) Classification
3 2 50
2 4 60
11 1 40
•G
http://www.cse.iitk.ac.in/users/se367/10/presentation_local/Binary%20Classification.html
Regression
• Hypothesis: H(X) = W X
x2
x1 (hours) y (score)
(attendance)
1 X
10 5 90 • Cost: cost(W ) =
m
(W X y)2
9 5 80
3 2 50
2 4 60
11 1 40
• GradientWdecent:
:= W ↵
@
cost(W )
@W
http://www.cse.iitk.ac.in/users/se367/10/presentation_local/Binary%20Classification.html
Classification
http://www.cse.iitk.ac.in/users/se367/10/presentation_local/Binary%20Classification.html
0, 1 encoding
http://www.cse.iitk.ac.in/users/se367/10/presentation_local/Binary%20Classification.html
https://www.youtube.com/watch?v=BmkA1ZsG2P4
https://www.youtube.com/watch?v=BmkA1ZsG2P4
Pass(1)/Fail(0) based on study hours
1 (pass)
0 (fail)
hours
Linear Regression?
1 (pass)
0 (fail)
hours
Linear regression
• We know Y is 0 or 1
H(x) = W x + b
http://www.holehouse.org/mlclass/06_Logistic_Regression.html
Logistic Hypothesis
H(x) = W x + b
logistic function,
sigmoid function.
sigmoid:
Curved in two directions,
like the letter "S",
or the Greek ς (sigma).
Logistic Hypothesis
1
H(X) = WTX
1+e
Lecture 5-2
Logistic (regression) classification:
cost function & gradient decent
c
cost(H(x), y) = ylog(H(x)) (1 y)log(1 H(x))
Minimize cost - Gradient decent algorithm
1 X
costc(W ) = ylog(H(x)) + (1 y)log(1 H(x))
m
@
W := W ↵ cost(W )
@W
Gradient decent algorithm
1 X
costc(W ) = ylog(H(x)) + (1 y)log(1 H(x))
m
@
W := W ↵ cost(W )
@W
e x t
N i a l
l ti n o m a x)
Mu (S o ftm
ca t i o n
si fi
c la s