DecisionTreeRegressionStat
Online VFDT decision-tree regressor; a piecewise-constant predictor over the feature space, growing on the fly via the Hoeffding bound. Wraps a RegressionTree in the kumulant RegressionStat contract so it composes with everything that consumes regressors (the bandit family, schemas, op pipelines).
Snapshots are immutable TreeRegressionResults carrying the frozen split structure and per-node weighted-variance aggregates; bandits pair this with a tree-aware com.eignex.kumulant.stat.regression.RegressionPosterior (e.g. MeanTreePosterior or ThompsonTreePosterior) to score arms at choose time.
Reward encoding lives at the call site; pre-transform y (e.g. ln(y)) before update. The internal leaf accumulator is fixed to VarianceStat's WeightedVarianceResult so the VarianceReduction split metric applies.
Use cases: non-linear regression where the relationship between context and target is piecewise constant or step-like; bandit reward modelling, contextual stratification, anything where linear regression would miss the structure. Reach for RandomForestRegressionStat for ensembled diversity.
Memory: O(nodes · splitCandidates); a VarianceStat per node plus per-audit-leaf candidate accumulators. Bounded by RegressionTreeConfig.maxNodes.
Update: O(depth) per observation; a tree walk to the destination leaf, then an arm update at that leaf. Splits fire at most once every RegressionTreeConfig.splitPeriod observations per audit leaf.
Concurrency: The hot update path touches exactly one accumulator; the leaf the observation routes to. Internal split nodes carry no live arm; subtree aggregates (rootSnapshot, TreeSplitResult.value) are derived by combining descendants at snapshot time. Each leaf arm is a VarianceStat honouring Concurrency, so multiple threads landing in different leaves never contend. Split conversion takes a per-tree lock fired only at split decisions. Predictions (the load-bearing consumer for bandits) are race-free; the root-level aggregate TreeRegressionResult.totalWeights / rootMean is best-effort under concurrent growth and may drift by a few ULPs of the workload; single-threaded runs are exact. See RegressionTree for the full concurrency design.
Constructors
DecisionTreeRegressionStat
Properties
concurrency
Thread-safety mode fixed at construction. See Concurrency for the shared contract and the implementation's KDoc for its cell and lock strategy.
config
Tunables shared with the underlying RegressionTree.
featureSize
Number of features expected in x on each update. Mismatched lengths throw.
splitCandidates
Candidate splits considered at every audit leaf. Pass an empty list to disable growth; the regressor then degenerates to a single global accumulator.
Functions
create
Create an independent accumulator at the configured baseline. A null concurrency preserves this accumulator's mode; a non-null value overrides it. Modality subtypes narrow the return type to preserve the input shape.
merge
Fold a compatible snapshot values into this accumulator at timestampNanos. Implementations document whether the combine is exact or approximate and which state the snapshot omits. The source accumulator is unaffected.
Time-dependent statistics, such as windows, place the snapshot at timestampNanos, which must share the clock the caller uses for updates and reads. Time-independent statistics ignore it.
read
Return the current result evaluated at timestampNanos. Time-independent statistics ignore the timestamp. Reading does not add an observation.
Snapshot consistency depends on the implementation's synchronisation. Locks protect coupled state under Concurrency.Strict and Concurrency.HighWrite; independently updated cells and JVM striped adders can still yield a best-effort snapshot. Concurrency.Relaxed permits drift across coupled cells.
reset
tree
Live underlying tree. Use for inspection / pretty-printing.
Convenience overload that wraps x as a DenseVector.
Timestamped convenience overload that wraps x as a DenseVector.
Record the pair (x, y) with weight at timestampNanos.