Sigmoid/Logistic function
g(z)=1+e−z1
Hypothesis
hθ(x)=g(θ⋅x)=1+e−θ⋅x1
- y=1 if hθ(x)≥0.5 (i.e. θ⋅x≥0)
- y=0 if hθ(x)<0.5 (i.e. θ⋅x<0)
Logistic Regression Cost Function
J(θ)=−m1[i=1∑myiloghθ(xi)+(1−yi)log(1−hθ(xi))]
Gradient Descent
θminJ(θ)
Repeat: simultaneously update all θj
θj:=θj−α∂θj∂J(θ)
θj:=θj−αi=1∑m(hθ(xi)−yi)xi
Regularization
J(θ)=−m1[i=1∑myiloghθ(xi)+(1−yi)log(1−hθ(xi))]+2mλi=1∑nθj2