Logarithmic Loss

Context: FIT2086_MOC · the only W7 measure that scores the probabilities rather than the labels · it is the negative log-likelihood of future data, so it is the classification twin of the held-out NLL in Plug-in Prediction and Held-Out Evaluation · the calibration counterpart to the ranking measure ROC and AUC · applied to the output of Logistic Regression

Quick Revision

  • 🎯 Objective: score each test point by the negative log-probability its model gave the true class ➔ sum over the test set ➔ smaller is better.
  • ⚡ Key Constraint: accuracy and AUC only see which class won; log-loss is the only one of the three that penalises being confidently wrong.

📝 Core

  • Per-sample score ➔ take of the probability the model assigned to the class that actually occurred:
  • Total over the test set ➔ ➔ this is exactly the negative log-likelihood of the new, future data under the fitted model.
  • Direction ➔ smaller score = better predictions; a probability of on the truth costs , and a probability approaching on the truth costs .
  • What it measures ➔ probabilistic predictive accuracy, i.e. how well the model predicts the probability of class membership, not merely how often it guesses the top class right.
  • Why that matters ➔ it tells you how much confidence to place in a predicted class ➔ and both predict class , but only the second is a confident claim, and log-loss is the measure that separates them.
  • Same object as the fitting objective ➔ the training NLL minimised in Logistic Regression and this test-set score are the same formula on different data ⟹ fit and evaluation share one currency.

⚠️ Common Mistakes

  • 💡 Scoring the predicted class instead of the truth ➔ log-loss always takes the probability the model gave the class that actually occurred, even when that class lost the argmax.
  • 💡 Treating “bigger is better” ➔ it is a loss; the sign convention is the same trap as the NLL in model selection (Model Selection and Information Criteria (AIC, BIC)).
  • 💡 Comparing log-loss across different test sets ➔ it is a sum, so it grows with ; only compare models scored on the same test data (or divide by first).

🧠 Active Recall