Log Odds

Log Odds

What is the meaning of Odds ?

Odds compare the likelihood of an event happening vs. not happening.

Odds = \(\frac{p}{1-p}\)

  • p = probability of success
Log Odds (Logit) Assumption

In logistic regression we assume that Log-Odds (the log of the ratio of positive class to negative class) is a linear function of inputs.

Log-Odds (Logit) = \(log_e \frac{p}{1-p}\)

Log Odds (Logit)

Log Odds = \(log_e \frac{p}{1-p} = z\)

\[z=w^{T}x+w_{0}\]

\[ \begin{align*} &log_{e}(\frac{p}{1-p}) = z \\ &⟹\frac{p}{1-p} = e^{z} \\ &\implies p = e^z - p.e^z \\ &\implies p = \frac{e^z}{1+e^z} \\ &\text { divide numerator and denominator by } e^z \\ &\implies p = \frac{1}{1+e^{-z}} \quad \text { i.e, Sigmoid function} \end{align*} \]
Sigmoid Function
Sigmoid function is the inverse of log-odds (logit) function, it converts the log-odds back to probability, and vice versa.
Range of Values
  • Probability: 0 to 1
  • Odds: 0 to + \(\infty\)
  • Log Odds: -\(\infty\) to +\(\infty\)



End of Section