How to use this calculator
Calculate mean binary log loss from actual labels and predicted positive-class probabilities.
- Enter Observed binary labels, Predicted probability of class 1. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How this calculation works
Mean binary log loss averages the negative log likelihood assigned to each observed binary outcome. Lower values indicate that the predicted probabilities assigned more mass to the outcomes that occurred.
Inputs and units
trueLabels— Observed binary labels- Enter one 0 or 1 outcome per observation.
positiveClassProbabilities— Predicted probability of class 1- Enter the probability assigned to class 1 for each corresponding observation.
Formula
Mean log loss = −(1/n)Σ[yᵢ ln(pᵢ) + (1−yᵢ) ln(1−pᵢ)].
Method
Pair each 0/1 outcome with its predicted probability for class 1. This page requires probabilities strictly between zero and one so every per-case logarithm remains finite.
Worked example
Labels 1, 0, 1, 0 with probabilities 0.90, 0.20, 0.70, 0.10 give a mean log loss of 0.197635 nats per observation.
Assumptions and limits
This computes in-sample or evaluation-cohort mean binary log loss only. It does not choose a classification threshold or assess calibration separately.
Frequently asked questions
What does log loss measure?
It penalizes probability assigned away from the observed binary outcome.
Why average across observations?
The cohort mean summarizes per-case negative log likelihood on a common per-observation scale.
Why reject probabilities of exactly zero or one?
They can produce infinite loss when the observed outcome contradicts a certain prediction.
How do I use the Binary Log Loss over Prediction Cohort Calculator?
Enter Observed binary labels, Predicted probability of class 1. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Binary Log Loss over Prediction Cohort?
Labels 1, 0, 1, 0 with probabilities 0.90, 0.20, 0.70, 0.10 give a mean log loss of 0.197635 nats per observation.
Reference: scikit-learn log-loss definition for binary observed labels and predicted probabilities. See our calculation methodology.