PinballLossStat
Streaming pinball / quantile loss at level tau. Paired input is (prediction, truth); the per-row loss is max(tau*(y - yhat), (tau - 1)*(y - yhat)), which equals |y - yhat| when tau = 0.5.
Used to evaluate quantile regressors (LightGBM/XGBoost quantile objective) and is the single-quantile analog of CRPS.
Use cases: quantile-regression model evaluation; choose tau = 0.5 for the median-loss / MAE-equivalent, tau near 0 or 1 to score tail predictions.
Memory: O(1); backed by a MeanStat.
Update: O(1) per paired observation.
Concurrency: Inherits MeanStat's concurrency model.
Constructors
PinballLossStat
Properties
concurrency
Thread-safety mode fixed at construction. See Concurrency for the shared contract and the implementation's KDoc for its cell and lock strategy.
tau
Functions
create
Create an independent accumulator at the configured baseline. A null concurrency preserves this accumulator's mode; a non-null value overrides it. Modality subtypes narrow the return type to preserve the input shape.
merge
Fold a compatible snapshot values into this accumulator at timestampNanos. Implementations document whether the combine is exact or approximate and which state the snapshot omits. The source accumulator is unaffected.
Time-dependent statistics, such as windows, place the snapshot at timestampNanos, which must share the clock the caller uses for updates and reads. Time-independent statistics ignore it.
read
Return the current result evaluated at timestampNanos. Time-independent statistics ignore the timestamp. Reading does not add an observation.
Snapshot consistency depends on the implementation's synchronisation. Locks protect coupled state under Concurrency.Strict and Concurrency.HighWrite; independently updated cells and JVM striped adders can still yield a best-effort snapshot. Concurrency.Relaxed permits drift across coupled cells.
reset
Restore the configured baseline, including any prior seed. Preserves the configuration and concurrency.