kumulant

RegressionStatGroup

StatGroup variant over regression inputs, so a schema's regression entries have a home.

Without it the declarator was reachable but unusable: every other group filters the schema by modality with mapNotNull, so a regression entry was silently skipped and the failure surfaced only as a missing key at read time.

Every entry must expect the same feature width, since one update fans out to all of them.

Constructors

RegressionStatGroup

constructor(stats: List<BoundStat<*, out RegressionStat<*>, *>>, concurrency: Concurrency? = null)(source)
constructor(vararg stats: BoundStat<*, out RegressionStat<*>, *>, concurrency: Concurrency? = null)(source)
constructor(vararg stats: Pair<StatKey<*>, RegressionStat<*>>, concurrency: Concurrency? = null)(source)
constructor(schema: StatSchema, concurrency: Concurrency = Concurrency.None)(source)

Properties

featureSize

open override val featureSize: Int(source)

Number of features expected in x on each update. Mismatched lengths throw.

Link copied to clipboard
override val concurrency: Concurrency

The group's effective level: the one it was built with when a caller supplied it, otherwise the weakest level any child uses.

Functions

create

open override fun create(concurrency: Concurrency? = null): RegressionStat<GroupResult>(source)

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.

Link copied to clipboard
override fun merge(values: GroupResult)

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.

Link copied to clipboard
override fun read(timestampNanos: Long = currentTimeNanos()): GroupResult

Materialise the current state as an immutable Result. Reads never mutate, so the caller can read as often as it likes without affecting the stream.

Link copied to clipboard
override fun reset()

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.

Link copied to clipboard
open fun update(x: F64VectorView, y: Double, weight: Double = 1.0)

Record an (x, y) observation with the given weight at the current time.

open fun update(x: DoubleArray, y: Double, weight: Double = 1.0)

Convenience overload that wraps x as a F64DenseVector.

open fun update(x: DoubleArray, y: Double, timestampNanos: Long, weight: Double = 1.0)

Timestamped convenience overload that wraps x as a F64DenseVector.

open override fun update(x: F64VectorView, y: Double, timestampNanos: Long, weight: Double = 1.0)

Record an (x, y) observation at timestampNanos with the given weight.

update

open override fun update(x: F64VectorView, y: Double, timestampNanos: Long, weight: Double = 1.0)(source)

Record an (x, y) observation at timestampNanos with the given weight.