Skip to content

Main content

Metrics: Log Loss Probability Term Tool

Return an explicitly weighted single-observation log-loss contribution by invoking the existing strict binary log-loss calculator, not a copied log formula.

Loading tool…

Description

Compute binary natural-log loss from probability and outcome, then multiply by nonnegative weight.

Probabilistic scores evaluate predictions against outcomes. Probability-domain rules, logarithm bases, and whether class terms are summed or averaged must be explicit.

Compute binary natural-log loss from probability and outcome, then multiply by nonnegative weight.

When to use this tool

Use Metrics: Log Loss Probability Term when you need one probability-loss term or its declared range.

How to use the tool and how it works

  1. Enter probability, outcome, weight. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Compute binary natural-log loss from probability and outcome, then multiply by nonnegative weight. Return both the unweighted and weighted terms.1

The linked strict binary log-loss calculator is invoked through the shared helper with one outcome and probability. It requires outcome zero or one and probability strictly inside (0, 1), including when the outer weight is zero.2

Input fieldMeaning and unitsAccepted input
probabilityPredicted probability, strictly greater than zero and less than one.Required. Finite number.
outcomeBinary observed label: zero or one.Required. Safe integer.
weightNonnegative multiplier; zero does not bypass probability/outcome validation.Required. Finite number.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.unweightedLogLossUnweighted Log LossCalculated result member: number.
result.weightedLogLossWeighted Log LossCalculated result member: number.
json
{
  "input": {
    "probability": 0.5,
    "outcome": 1,
    "weight": 2
  },
  "output": {
    "result": {
      "unweightedLogLoss": 0.6931471805599453,
      "weightedLogLoss": 1.3862943611198906
    }
  }
}

Limitations and assumptions

  • Probability must be strictly between zero and one and outcome must be zero or one, even when weight is zero; no endpoint clipping or dataset averaging is added.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete set of validated predictions and examine calibration as well as aggregate score.

References

  1. Calculation and input contract: metrics/log-loss-probability-term — tool.io

  2. Calculation or validation: information/log-loss — tool.io

Similar or alternative tools