kumulant

StochasticRegressionResult

@Serializable
@SerialName(value = "StochasticRegressionResult")
data class StochasticRegressionResult(val weights: DenseVector, val bias: Double, val totalWeights: Double, val step: Long, val link: Link = Link.Identity, val sse: Double = 0.0, val updaterState: List<VectorView> = emptyList()) : LinearRegressionResult(source)

SGD weight estimates with no posterior. Cheap, no uncertainty quantification. sse carries the accumulated per-link loss; for Link.Identity this is the classical SSE, for Link.Logit / Link.Log it is the GLM deviance (negative log-likelihood). HasRegression.mse / HasRegression.rmse / HasRegression.rSquared are only natural under Identity.

Constructors

Link copied to clipboard
constructor(weights: DenseVector, bias: Double, totalWeights: Double, step: Long, link: Link = Link.Identity, sse: Double = 0.0, updaterState: List<VectorView> = emptyList())

Properties

Link copied to clipboard
open override val bias: Double

Fitted bias / intercept term.

Link copied to clipboard
open val featureSize: Int

Number of features in weights.

Link copied to clipboard
open override val link: Link

Canonical link applied at prediction time; the stored weights and bias live in the linear-predictor space, predict returns the link-mapped mean.

Link copied to clipboard
open val mse: Double

Mean squared error: sse / totalWeights. Zero on an empty stream.

Link copied to clipboard
open val rmse: Double

Root mean squared error: sqrt([mse]).

Link copied to clipboard
open val rSquared: Double

Coefficient of determination 1 - sse/sst. Zero when sst is zero.

Link copied to clipboard

Unbiased sample standard deviation: sqrt([sampleVariance]).

Link copied to clipboard

Unbiased sample variance: [sst] / ([totalWeights] - 1). Zero when totalWeights <= 1.

Link copied to clipboard
open override val sse: Double

Sum of squared errors (residuals). Under non-identity GLMs this is the deviance.

Link copied to clipboard
open val ssr: Double

Sum of squares due to regression: sst - sse.

Link copied to clipboard
open val sst: Double

Sum of squared deviations from the running mean: Sum (x - mean)^2 * weight.

Link copied to clipboard
open val stdDev: Double

Population standard deviation: sqrt([variance]).

Link copied to clipboard
open override val step: Long

Number of com.eignex.kumulant.core.RegressionStat.update calls absorbed; useful as a bookkeeping counter for learning-rate decay or retraining cadence.

Link copied to clipboard
open override val totalWeights: Double

Cumulative observation weight folded in.

Link copied to clipboard

Per-optimiser auxiliary state (e.g. Adam's m/v); empty for plain SGD.

Link copied to clipboard
open val variance: Double

Population variance: [sst] / [totalWeights]. Zero on an empty stream.

Link copied to clipboard
open override val weights: DenseVector

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

Functions

Link copied to clipboard

Linear predictor eta = bias + x . weights, before the inverse link.

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

Mean response: link.invMean(linearPredictor(x)). For Link.Identity this is the linear predictor itself, matching plain linear regression.

StochasticRegressionResult

constructor(weights: DenseVector, bias: Double, totalWeights: Double, step: Long, link: Link = Link.Identity, sse: Double = 0.0, updaterState: List<VectorView> = emptyList())(source)

bias

open override val bias: Double(source)

Fitted bias / intercept term.

sse

open override val sse: Double(source)

Sum of squared errors (residuals). Under non-identity GLMs this is the deviance.

step

open override val step: Long(source)

Number of com.eignex.kumulant.core.RegressionStat.update calls absorbed; useful as a bookkeeping counter for learning-rate decay or retraining cadence.

totalWeights

open override val totalWeights: Double(source)

Cumulative observation weight folded in.

updaterState

Per-optimiser auxiliary state (e.g. Adam's m/v); empty for plain SGD.

weights

open override val weights: DenseVector(source)

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