MSE or Cross Entropy: Picking a Loss for a Probabilistic Classifier

MediumClassical ML

Reported in interviews at Amazon Autodesk Genpact Infosys Netflix Two Sigma

Problem statement

How would you choose between squared error and cross-entropy for a binary classifier? The model turns a logit into a probability through a sigmoid, and a colleague suggests using squared error. Compare how the losses train, how they score probabilities, and how they handle noisy labels.

Show hint

What does the chain rule leave behind when you differentiate each loss through the sigmoid rather than with respect to the probability?

Relevant roles: ML Engineer, Deep Learning Engineer, Applied Scientist and Data Scientist.

Related free problems