kumulant

HasRegression

Result trait for regression error metrics. Extends HasSampleVariance because R² is defined as 1 - sse/sst, and sst is the variance-family sum of squared deviations from the mean.

Implemented by com.eignex.kumulant.stat.regression.glm.LinearRegressionResult. Consumers asking for HasRegression don't care which underlying regressor produced the snapshot; SGD, Bayesian, diagonal, or hierarchical all surface the same sse / mse / rmse / rSquared metrics.

Under non-identity GLMs (Link.Logit, Link.Log) sse carries the per-link deviance, not the classical SSE, and rSquared is not the usual Gaussian R². Each GLM result documents its sse interpretation.

Inheritors

Properties

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
abstract 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
abstract val totalWeights: Double

Cumulative weight of observations folded into this result.

Link copied to clipboard
open val variance: Double

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

mse

open val mse: Double(source)

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

rSquared

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

rmse

open val rmse: Double(source)

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

sse

abstract val sse: Double(source)

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

ssr

open val ssr: Double(source)

Sum of squares due to regression: sst - sse.