Contents
Logistic Regression/Chapter 09 of 09
09Summary
- The model. A line leaves [0,1]; logistic regression squashes a linear score, p=\sigma(w^\top x), so the log-odds \log\frac{p}{1-p}=w^\top x is linear and e^{w_j} is an odds ratio (radius: 2.8).
- Maximum likelihood. Each label is a coin flip, p^y(1-p)^{1-y}; minus the log of the likelihood is cross-entropy, and each example pays -\log of the probability it gave the truth (0.01 for p=0.99, 3.9 for p=0.02).
- The push. Cross-entropy: \partial J/\partial z=p-y, \nabla_wJ=X^\top(p-y). Squared error: 2(p-y)\,p(1-p), which vanishes when the model is confidently wrong (26 times weaker for our small tumor; 489 steps instead of 15).
- One bowl. Cross-entropy: Hessian X^\top SX\succeq0, convex. Squared error on a sigmoid: not convex, plateaus, possibly many local minima.
- Follow-ups. Separable classes: weights diverge, add L_2. More classes: softmax with cross-entropy. The boundary w^\top x=0 is linear; curves need new features.