A 1-D dataset has with and with , and the model is (no intercept). How do you show that the maximum-likelihood estimate does not exist, what happens to the Hessian, and how does an L2 penalty fix it?
Supervised learning, Logistic regression
Level L4 Advanced. Length Long. Nature Mat Mathematical.
What's being asked
The effect of perfect separation on MLE: the likelihood increases without bound as .
Key idea
When data are linearly separable, the log-likelihood has no maximum. It keeps increasing as grows, because the fitted probabilities approach 0 and 1. An L2 penalty makes the objective strictly convex and gives a finite solution.
Steps
- Negative log-likelihood: for the loss is , for it is . So .
- for every , so decreases for all and only as . No finite minimiser exists.
- Hessian: , which tends to 0 as . Newton's step is , which is always above 1 and tends to 1. So in this example grows by about 1 per iteration and never converges (the step size depends on this example; in general Newton's steps on separable data need not be 1).
- General statement: if some gives for all (relabelling the classes as ), then scaling up always lowers the loss.
- Fix: minimise . Setting the derivative to zero: , which has exactly one finite root. Call the left side : , as , and , so crosses zero once.
- Other fixes: early stopping, a prior (MAP), or noting that the direction converges to the max-margin direction (a hint at the link with SVM).
Common mistakes
- Concluding that perfect separation means a perfect model. The estimates are huge and unstable and the probabilities are over-confident.
- Reporting the software's final as the MLE. It is just where the iterations stopped.
- Penalising the intercept too. It is usually left unpenalised, and penalising only the slope weights is enough to remove the divergence.
How long your answer should be
Half a page to one page; 6 minutes.
Read this
Previous in Supervised learning: Describe the least angle regression (LAR) algorithm and how it relates to the lasso path. In the case (two orthonormal columns) with : what is the path of coefficients as a function of the penalty , and where does each variable enter?
Next in Supervised learning: Describe how partial least squares (PLS) builds its first component, and how it differs from principal components regression (PCR). Take centred with , for samples: what are the first PLS direction and the one-component fit coefficients, and how do they compare with OLS?