kumulant

HasLinearModel

Result trait for accumulators that produce a fitted linear model y = bias + weights . x. Covers both the univariate special case (HasSlope; slope + intercept) and the multivariate case (com.eignex.kumulant.stat.regression.glm.LinearRegressionResult; weights vector + scalar bias) behind one surface.

Consumers written against HasLinearModel handle any linear model uniformly: contextual bandits use it for scoring, downstream pipelines use it for prediction, evaluation metrics use it for residuals.

The predict method evaluates bias + Sum_i weights[i] * x[i]. For generalised linear models with a non-identity link the linear predictor eta (this method) and the response mean mu = link.invMean(eta) are distinct; the linear-model-specific result types expose both.

Inheritors

Properties

Link copied to clipboard
abstract val bias: Double

Fitted bias / intercept term.

Link copied to clipboard
open val featureSize: Int

Number of features in weights.

Link copied to clipboard
abstract val weights: VectorView

Fitted weight per feature, indexed by the same i as the input x[i].

Functions

Link copied to clipboard
open fun predict(x: VectorView): Double

Evaluate the linear predictor at x: bias + Sum_i weights[i] * x[i]. For Gaussian regression this is the prediction; for non-identity GLMs this is the linear predictor pre-link.

bias

abstract val bias: Double(source)

Fitted bias / intercept term.

featureSize

Number of features in weights.

predict

Evaluate the linear predictor at x: bias + Sum_i weights[i] * x[i]. For Gaussian regression this is the prediction; for non-identity GLMs this is the linear predictor pre-link.

weights

abstract val weights: VectorView(source)

Fitted weight per feature, indexed by the same i as the input x[i].