RegressionStat
Accumulator over vector-covariate / scalar-response observations (x, y, weight), where x is a fixed-dimensional feature vector and y is the scalar target. The multivariate generalisation of PairedStat and the input shape for every linear / non-linear regressor.
Implementations cover the full spread from a one-pass SGD weight tracker (StochasticRegressionStat) to a full Bayesian linear regression with a joint posterior (BayesianRegressionStat) to a non-linear decision tree (DecisionTreeRegressionStat). They share the update shape and differ in what they expose on read.
Inputs are passed as Vector so callers can submit sparse feature vectors without materialising them into dense arrays first. The DoubleArray convenience overloads wrap the array in a DenseVector; the sparse path goes through com.eignex.koblas.SparseVector.
The K-way classifiers (SoftmaxRegressionStat, GaussianNaiveBayesStat) also use this interface; y is the class index in [0, numClasses).
Inheritors
Properties
featureSize
Number of features expected in x on each update. Mismatched lengths throw.
Thread-safety mode fixed at construction. See Concurrency for the shared contract and the implementation's KDoc for its cell and lock strategy.
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.
update
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.
Return the current result evaluated at timestampNanos. Time-independent statistics ignore the timestamp. Reading does not add an observation.
Restore the configured baseline, including any prior seed. Preserves the configuration and concurrency.