Upstart · ML & AI Fundamentals
Derive logistic regression objective and gradients
TrueInterview
October 7, 2026 · 1 min read
Consider binary logistic regression with data , where . Using the sigmoid and linear score : a) Write the exact maximum-likelihood optimization objective, and state clearly whether it is a maximization or minimization, both without and with L2 regularization of strength . b) Write out the explicit negative log-likelihood (cross-entropy) . c) Derive the gradients and . d) Clarify the distinction among 'objective', 'loss', and 'regularized objective' in this context. Overview: This question tests understanding of logistic regression, maximum likelihood estimation, cross-entropy (negative log-likelihood), L2 regularization, and the ability to compute model gradients for binary classification.