LinearRegressionResult
Common shape across multivariate-x linear regression snapshots.
Concrete subtypes add uncertainty quantification:
StochasticRegressionResult: point estimates only.
DiagonalRegressionResult: per-coefficient precision (factorised posterior).
PrecisionRegressionResult: full posterior as the Cholesky factor of its precision.
Sealed + @Serializable. Concrete weights round-trip as DenseVector; the public field is typed Vector so a sparse variant can swap in without breaking callers. Regression error metrics from HasRegression become meaningful once sse is tracked; implementations that don't accumulate it return 0.0.
Inheritors
Properties
bias
link
step
Number of com.eignex.kumulant.core.RegressionStat.update calls absorbed; useful as a bookkeeping counter for learning-rate decay or retraining cadence.
totalWeights
Cumulative weight of observations folded into this result.
weights
Number of features in weights.
True when totalWeights is not positive, including zero, negative values, and NaN.
Mean squared error: sse / totalWeights. Zero on an empty stream.
Unbiased sample standard deviation: sqrt([sampleVariance]).
Unbiased sample variance: [sst] / ([totalWeights] - 1). Zero when totalWeights <= 1.
Functions
linearPredictor
Linear predictor eta = bias + x . weights, before the inverse link.
predict
Mean response: link.invMean(linearPredictor(x)). For Link.Identity this is the linear predictor itself, matching plain linear regression.