Show that logistic regression loss is convex (Applied Scientist screen)

MediumConcept20 minASSWERSPro outline

The question

Show that the log loss of logistic regression is convex in the weights. Then explain why that matters for training, and whether the same holds for a neural network trained with the same loss.

What the interviewer is looking for

  • Writes the loss correctly with the sigmoid
  • Derives the gradient X^T (p - y)
  • Derives the Hessian X^T S X with S diagonal p(1 - p) and shows it is positive semidefinite
  • Explains that convexity means any local minimum is global
  • Explains that a neural network is not convex in its weights even with the same loss

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported Microsoft (Microsoft AI, Microsoft Research, and the general Microsoft SWE loop) question type: Derivation-style ML math, such as showing a common classification loss is convex.

Reported in: easylearnspace.com

Practice question written by BlogLLM based on publicly reported interview formats. Not an official Microsoft (Microsoft AI, Microsoft Research, and the general Microsoft SWE loop) question.