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.
- Cost
Series - Observed, estimated and unknown cost, never mixed into one total.
- Scored
- Labeled probability vectors, scored.
Enums§
- Case
Outcome - A comparable case’s outcome category.
- Measure
- A metric’s value, or why there is none.
Traits§
- Task
Adapter - 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)^2added left to right from zero, or why it has none. Summing these over cases does not in general reproducebrier’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 termmean_log_losssubtracts, 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.