PlattCalibratorStat
Online Platt scaling: fits a one-feature logistic regression sigmoid(slope * rawScore + intercept) over paired (rawScore, label) observations where label is in {0, 1}. Use to fix the calibration of a classifier whose probability output is poorly aligned with the empirical positive rate.
Internally wraps a StochasticRegressionStat with featureSize = 1 and Link.Logit. The runtime cost matches a one-dimensional GLM-SGD update per observation.
Use cases: post-hoc calibration of tree / SVM / naive-Bayes outputs; pair with ReliabilityStat to monitor the gap before and after applying the learned mapping.
Memory: O(1); backed by StochasticRegressionStat.
Update: O(1) per observation.
Concurrency: Inherits StochasticRegressionStat's concurrency model.
Constructors
PlattCalibratorStat
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.
optimizer
Optimizer driving the underlying logistic regression.
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
Folds another Platt result into this one by reconstructing a StochasticRegressionStat snapshot from (slope, intercept, totalWeights, step) and delegating to the underlying merge. The residual sum of squares is not carried.
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.