Logistic Regression: Log_odds > odds > probability

PHOTO EMBED

Tue Nov 22 2022 20:52:35 GMT+0000 (Coordinated Universal Time)

Saved by @janduplessis883 #univariateregression #python

# Log-odd is the Logit intercept 
log_odd = -0.473288 
print(f"log_odd = -0.473288 ")

# Calculation odds -> compute e-function on the logit using exp() “de-logarithimize”
odds = np.exp(log_odd)
print(f'odds = {odds}  Round:{round(odds, 2)}')

# To convert from odds to a probability, divide the odds by one plus the odds.
prob = odds / (1 + odds)
print(f'prob = {prob} Round:{round(prob, 2)}')
content_copyCOPY

Calculating Probability from log_odd

https://github.com/janduplessis883/data-logit/blob/master/Logistic%20Regression.ipynb