Log Loss Calculator

Evaluate binary and multiclass probability predictions, compare models, apply weights, inspect per-row penalties, validate inputs, and export clear machine-learning log loss results with confidence.

Calculation Results

Interpretation

Model Comparison

Detailed Calculation Table

Confusion Summary

Loss by Observation

Average Loss by Actual Class

Calculator Inputs

Default is 10⁻¹⁵.

Paste or Import Data

Formula Used

Binary log loss
L = −(1/N) Σ [yᵢ ln(pᵢ) + (1 − yᵢ) ln(1 − pᵢ)]
Multiclass log loss
L = −(1/N) Σᵢ Σ꜀ yᵢ,꜀ ln(pᵢ,꜀)
Weighted log loss
L = −[Σᵢ wᵢ Σ꜀ yᵢ,꜀ ln(pᵢ,꜀)] ÷ Σᵢ wᵢ

Here, N is the observation count. The actual label selects the correct-class probability. Lower loss indicates stronger probabilistic predictions.

How to Use

  1. Select binary or multiclass classification.
  2. Choose probability units, logarithm base, and precision.
  3. Enter actual labels and predicted probabilities.
  4. Enable weights, clipping, normalisation, or model comparison.
  5. Calculate and inspect summaries, row penalties, and charts.
  6. Copy, print, or export the completed results.

Example Data

ObservationActual labelPredicted probabilityIndividual loss
110.900.105361
200.200.223144
310.600.510826

The mean natural-log loss for these predictions is approximately 0.279777. A confident wrong prediction would increase the score sharply.

Log Loss Guidance

Log loss rewards accurate probabilities. It also penalises unjustified confidence. Values approaching zero indicate excellent predictions.

Accuracy checks only final classes. Log loss evaluates the full probability distribution. Two equally accurate models can have different losses.

There is no universal good threshold. Compare against baselines and prior models. Always consider class balance and deployment costs.

Frequently Asked Questions

What does a lower log loss mean?

It means predicted probabilities align more closely with actual outcomes. Zero is the ideal limiting value.

Why are probabilities clipped?

Clipping prevents logarithms of zero. It also keeps calculations finite for extreme probabilities.

Can log loss be greater than one?

Yes. Confident incorrect predictions can create values much greater than one.

Does log loss work for multiclass models?

Yes. The calculator uses the predicted probability assigned to each actual class.

Must multiclass probabilities total one?

Normally, yes. Optional normalisation can correct small row-sum differences.

How do sample weights affect results?

Rows with larger weights contribute more strongly to the final weighted average.

Is log loss the same as cross-entropy?

In common classification settings, log loss is the average cross-entropy objective.

Which logarithm base should I use?

Natural logarithms are standard. Other bases rescale values without changing model rankings.

Can I compare two models here?

Yes. Enable comparison mode and provide probabilities for Models A and B.

Related Calculators

Confusion Matrix CalculatorClassification Accuracy CalculatorRecall CalculatorSpecificity CalculatorSensitivity CalculatorFalse Positive Rate CalculatorFalse Negative Rate CalculatorMatthews Correlation Coefficient CalculatorBalanced Accuracy CalculatorBinary Cross-Entropy Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.