A 1-D dataset has x=−1 with y=0 and x=+1 with y=1, and the model is P(y=1∣x)=σ(wx) (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 ∥w∥→∞.

Key idea

When data are linearly separable, the log-likelihood has no maximum. It keeps increasing as w grows, because the fitted probabilities approach 0 and 1. An L2 penalty makes the objective strictly convex and gives a finite solution.

Steps

  1. Negative log-likelihood: for x=1,y=1 the loss is log⁡(1+e−w), for x=−1,y=0 it is −log⁡(1−σ(−w))=log⁡(1+e−w). So L(w)=2log⁡(1+e−w).
  2. L′(w)=−2σ(−w)=−2/(1+ew)<0 for every w, so L decreases for all w and L(w)→0 only as w→∞. No finite minimiser exists.
  3. Hessian: L′′(w)=2σ(w)σ(−w), which tends to 0 as w→∞. Newton's step is −L′/L′′=1/σ(w)=1+e−w, which is always above 1 and tends to 1. So in this example w 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).
  4. General statement: if some w gives yiw⊤xi>0 for all i (relabelling the classes as yi∈{±1}), then scaling w up always lowers the loss.
  5. Fix: minimise L(w)+λ2w2. Setting the derivative to zero: −2σ(−w)+λw=0, which has exactly one finite root. Call the left side f(w): f(0)=−1<0, f(w)→∞ as w→∞, and f′=L′′+λ>0, so f crosses zero once.
  6. Other fixes: early stopping, a prior (MAP), or noting that the direction w/∥w∥ converges to the max-margin direction (a hint at the link with SVM).

Common mistakes

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 X=I2 (two orthonormal columns) with y=(3,1): 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 X with X⊤X=4I2, X⊤y=(4,3)⊤ for n=4 samples: what are the first PLS direction and the one-component fit coefficients, and how do they compare with OLS?