Skip to main content

Module metrics

Module metrics 

Source
Expand description

Metric definitions (spec 004, 3.5.4 to 3.5.7). Every metric states its numerator, denominator and exclusions; a zero denominator, a non-finite value or an incompatible input is unknown, never a pass.

Structs§

Bin
One reliability bin over top-label confidence.
CostSeries
Observed, estimated and unknown cost, never mixed into one total.
Scored
Labeled probability vectors, scored.

Enums§

CaseOutcome
A comparable case’s outcome category.
Measure
A metric’s value, or why there is none.

Traits§

TaskAdapter
How a task reads its judgments and labels.

Functions§

brier
Multiclass Brier: sum_case sum_class (p - y)^2 / n.
brier_term
One case’s Brier sum, sum_class (p - y)^2 added left to right from zero, or why it has none. Summing these over cases does not in general reproduce brier’s bits, which add every term to one running sum, so spec 029 does not use it as a per-case measure yet.
cost
log_loss_term
One case’s log loss contribution, -ln(p[label]) (spec 029, 3.2.3): the term mean_log_loss subtracts, or why it has none.
mean_log_loss
-sum(ln(p[label])) / n; a zero true-class probability is an explicit infinite-loss diagnostic and an unknown finite metric, never clipped.
nearest_rank
Nearest-rank quantile: the ceil(q * n)th smallest value, one-based.
probabilities
The probability vector a step’s raw output yields, computed with the core’s own validation, normalization and calibration. Scores, labels, ranks and unresolved values never become probabilities.
reliability
Reliability over half-open bins [b_i, b_{i+1}), the last closed at 1. The top label is the first option with the greatest mass.
reliability_bin
A scored case’s reliability bin: the bin index, the top-label confidence and the top label. The top label is the first option with the greatest mass; bins are half-open [b_i, b_{i+1}), the last closed at 1. None for a case with no option or no bin.