kumulant

RegressionNode

sealed interface RegressionNode<Row>(source)

Internal tree node, generic over the feature Row the tree routes. The hot update path touches only the leaf an observation routes to; internal split nodes are never written by RegressionTree.update. Splits may carry an optional carryover arm: a one-shot snapshot of the pre-split aggregate captured at the moment a leaf converts into a split, plus any orphaned aggregates folded in by mixed-structure merges. Subtree aggregates include the carryover but the hot path never reads or writes it.

Inheritors

Functions

findLeaf

abstract fun findLeaf(row: Row): RegressionLeafNode<Row>(source)

Walk to the leaf this row resolves to.

Link copied to clipboard

Public per-node subtree aggregate over all observations routed through this node (leaves: the arm snapshot; splits: the exact Chan-merge of both children plus any RegressionSplitNode.carryover). Lets callers score internal nodes — e.g. a Thompson walk-down that picks a branch by its subtree's posterior — without the tree having to keep a live arm on every split node. Equivalent to a directly-accumulated internal arm: Chan's parallel merge is exact for weighted-variance aggregates.

Link copied to clipboard

Freeze a live VectorView tree node into an immutable, serializable snapshot. Internal split aggregates are derived from the snapshotted children so the wire format stays stable even though live splits hold no arm.