On four test examples with true labels , Model A predicts probabilities and Model B predicts . Both achieve 75% accuracy at threshold 0.5; what is the binary log loss of each model, and why do they differ so sharply?
ML systems and evaluation, Classification metrics
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can compute binary cross-entropy (log loss) and understand why it penalises overconfident errors.
Key idea
Binary log loss is , where is the number of examples and is the predicted probability of class 1; as the probability assigned to the true class approaches 0, grows toward .
Steps
- For Model A on , the probabilities assigned to the true classes are .
- Compute Model A’s log loss (in nats): .
- For Model B, the true-class probabilities are , giving .
- Explain the gap: accuracy treats both 0.99 and 0.55 on the fourth point as identical mistakes, whereas log loss heavily penalises Model A’s 99% confidence on a false positive ( vs ).
Common mistakes
- Forgetting to take when the true label is , especially on the fourth example ().
- Mixing natural logarithms (nats) and base-2 logarithms (bits) when comparing log-loss values across models.
How long your answer should be
Four lines of arithmetic and two sentences of interpretation; 3 minutes.
Read this
Previous in ML systems and evaluation: A disease screening model tested on 200 patients produces , , and . What are precision, recall, and , and why does a screening task favour ?
Next in ML systems and evaluation: A regression model predicts for true targets . What are the MAE and RMSE, why is RMSE strictly larger here, and when is each metric preferred?