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 covariance (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 VectorView 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.kumulant.math.SparseVector.
The K-way classifiers (SoftmaxRegressionStat, GaussianNaiveBayesStat) also use this interface; y is the class index in [0, numClasses).
Inheritors
Properties
The thread-safety contract this stat was constructed with. Each stat picks the cell-encoding and lock strategy that honours this contract for its mathematical structure:
Number of features expected in x on each update. Mismatched lengths throw.
Functions
Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.
Fold another accumulator's snapshot into this one. The unit of merge is the immutable Result; not a live Stat; which is what lets the merge cross a process boundary. Many workers track slices of the same stream, call read periodically, ship snapshots to a coordinator, and the coordinator merges them in.
Reset the stat to its prior-seeded baseline. Equivalent to constructing a fresh stat with the same configuration, but in place; keeps the same Concurrency and any per-stat tunables.
Record an (x, y) observation with the given weight at the current time.
Convenience overload that wraps x as a DenseVector.
Record an (x, y) observation at timestampNanos with the given weight.
Timestamped convenience overload that wraps x as a DenseVector.
create
Spawn a fresh accumulator with the same configuration. Optionally override the Concurrency; useful for materialising a wire spec at a different concurrency level than the source.
The returned stat is independent: its state starts at the configured baseline, not at the source's current state. Each modality subtype narrows the return type so chaining doesn't lose the modality.
featureSize
Number of features expected in x on each update. Mismatched lengths throw.
update
Record an (x, y) observation with the given weight at the current time.
Record an (x, y) observation at timestampNanos with the given weight.
Convenience overload that wraps x as a DenseVector.
Timestamped convenience overload that wraps x as a DenseVector.