How do we train a logistic regression model? How do we interpret its coefficients?
How do we train a logistic regression model? How do we interpret its coefficients?
log(odds)=log(P(y=1|x)P(y=0|x))=log(odds)=log(P(y=1|x)P(y=0|x))= is a linear function of the input features
Minimization objective/Cost function:
-J(β)=−1m∑mi=1yilog(hβ(xi))+(1−yi)log(1−hβ(xi))J(β)=−1m∑i=1myilog(hβ(xi))+(1−yi)log(1−hβ(xi))
-Where: hβ(x)=g(βTx)hβ(x)=g(βTx) and g(z)=11+e−zg(z)=11+e−z (sigmoid function)
-Intuition:
- if yi=0yi=0, J(β)=log(1−hβ(x)i)J(β)=log(1−hβ(x)i), will converge to ∞∞ as hβ(x)ihβ(x)i becomes far from 0
- Converse: when yi=1yi=1, J(β)=log(hβ(x)i)J(β)=log(hβ(x)i), will converge to ∞∞ as hβ(x)ihβ(x)i becomes far from 1
Interpretation of the coefficients: the increase of logoddslogodds for the increase of one unit of a predictor, given all the other predictors are fixed.