Logistic Regression Equation Derivation

Dharmendra Sahani
2 min readOct 11, 2020

--

In this knowledge sharing Article I would like to share how we can derive Logistic Regression equation from Linear Regression or Equation of straight line.

Our Linear Regression Equation is

P = C + B1X1 + B2X2 + BnXn

Where the value of P ranges between -infinity to infinity. Let’s try to derive Logistic Regression Equation from equation of straight line. In Logistic Regression the value of P is between 0 and 1. To compare the logistic equation with linear equation and achieve the value of P between -infinity to infinity we need to change the range of P in logistic equation. Here two transformations we will do. First transformation would be to divide P by 1-P which gives us the value between 0 and infinity.

P/1-P

If P= 0, 0/1–0 which is 0 and if P= 1, 1/1–1 which is infinity. Now the value of P ranges from 0 and infinity.

In second transformation if we apply log function to P/1-P then log of 0 becomes -(infinity) and log of infinity is infinity. The equation will look something like this

log (P / 1-P) = C+ B1X1 + B2X2 + BnXn . This equation is called the Logit Function. Further we can derive Logistic Function from this equation as below.

In the above equation

e = Euler’s Number
C = Constant
B1 = Coefficient of X1
B2 = Coefficient of X2
X1 = Independent Variable
X2 = Independent Variable
P = Probability

Hope this Article will be helpful in understanding how we can derive Logistic Function Equation from Equation of Straight Line or Linear Regression.

--

--

Dharmendra Sahani

For Mentorship on learning AI/ML with Azure/AWS/GCP Cloud Tec, Please feel free to connect with me here https://in.linkedin.com/in/dharmendra-sahani-bb92b11b6