Professional Documents
Culture Documents
Logistic Regression Notes
Logistic Regression Notes
Regression
Notes
Logistic Regression
Overview
1. Probabilistic
1.1 Perceptron
2 So max Regression
4 Geometric
ff
f
t
Overview
Logistic Regression is a classi cation algorithm which
nds the probabilities of the data points to belong to a
default class. We can understand Logistic Regression
by Geometry, Probability, and loss function based
interpretation. Logistic Regression is simply a
classi cation technique whose task to nd a
hyperplane (n-Dimensional) or line (2-D) that best
separates the classes.
Types
Intuition
Equation
n
∑
xi ⋅ wi + b
i=1
Explanation
Step function
{0 if z ≤ 0
1 if z > 0
step(z) =
Training Process
Formula
Magnitude
Formula
−1 n
L (y, ^y) = [yi log( ^yi )) + (1 − yi ) log(1 − ^yi )]
n ∑
i=1
Gradient Discent
Formula
d σ (x)
= σ (x) ⋅ (1 − σ (x))
dx
1
σ (x) is de ned as
1 + e −x
∂ J(βj ) 1 n
(yi − ^yi ) ⋅ xij
n∑
=−
∂βj i=1
Confusion Matrix
Predicted Class
Predicted Class
TP + TN
Accuracy =
TP + TN + FP + FN
Precision
Formula
e zi
e(z)i = k
∑i=1 ∑ ezj
Loss Function
Formula
1 m k
y i ∗ log( ^yk i )
m∑ ∑ k
Cross−Entropy Loss = −
i=1 k=1
Formula
Hyperplane
wT x + b = 0
Case 1
ffi
ff
fi
fi
f
t
If positive point and classi er indicating its a positive
point yi w T x i>0 which means the plane is correctly
classifying the point.
Case 2
Case 3
Case 4
1. It is easily di erentiable.
1. Numerical Stability
2. Mathematical Convenience