Why logistic regression is fit by maximum likelihood and how that relates to minimizing log-loss

Quick Overview

Asks why logistic regression is fit by maximum likelihood and how that relates to minimizing binary cross-entropy, also called log-loss. Tests the Bernoulli likelihood, the algebra linking the two objectives, convexity and gradients, and what happens with separable data or regularization.

Why logistic regression is fit by maximum likelihood and how that relates to minimizing log-loss

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why is maximum likelihood estimation used to fit logistic regression, and how does it relate to minimizing binary cross-entropy (log-loss)? ```hint One observation Write the probability the model assigns to a single observed label as one expression that works for both y = 0 and y = 1. ``` ```hint From product to sum Take the log of the product over all observations and compare it term by term with the log-loss formula. ``` ### What a Strong Answer Covers - The probabilistic model behind logistic regression and the likelihood it implies - The algebra that connects the log-likelihood and binary cross-entropy, including the sign and the scaling - Why this objective is preferred over alternatives such as squared error - How the objective is optimized and what statistical properties the estimates have - When the maximum likelihood estimate fails to exist and how regularization changes the interpretation ### Follow-up Questions - Why not fit logistic regression by minimizing squared error on the predicted probabilities? - What happens to the maximum likelihood estimate when the two classes are perfectly separable? - How does adding an L2 penalty change what the objective means statistically? - Does a model trained to minimize log-loss produce calibrated probabilities?

Overview: Asks why logistic regression is fit by maximum likelihood and how that relates to minimizing binary cross-entropy, also called log-loss. Tests the Bernoulli likelihood, the algebra linking the two objectives, convexity and gradients, and what happens with separable data or regularization.

General logo
General
Nov 25, 2026
mediumData ScientistOtherMachine Learning
0
0

Why is maximum likelihood estimation used to fit logistic regression, and how does it relate to minimizing binary cross-entropy (log-loss)?

What a Strong Answer Covers Guidance

  • The probabilistic model behind logistic regression and the likelihood it implies
  • The algebra that connects the log-likelihood and binary cross-entropy, including the sign and the scaling
  • Why this objective is preferred over alternatives such as squared error
  • How the objective is optimized and what statistical properties the estimates have
  • When the maximum likelihood estimate fails to exist and how regularization changes the interpretation

Follow-up Questions Guidance

  • Why not fit logistic regression by minimizing squared error on the predicted probabilities?
  • What happens to the maximum likelihood estimate when the two classes are perfectly separable?
  • How does adding an L2 penalty change what the objective means statistically?
  • Does a model trained to minimize log-loss produce calibrated probabilities?