RandomForestRegressionStat
Online random-forest regressor; a population of RegressionTrees sharing the candidate-split pool. Diversity comes from:
Oza & Russell online bagging: per-tree Poisson(1) reweighting at every update.
Per-leaf mtry: each tree's audit leaves consider a random subset of the candidate splits, drawn at leaf birth from the tree's own RNG.
Snapshot is a ForestRegressionResult carrying every per-tree TreeRegressionResult; tree-aware posteriors merge per-tree leaf aggregates at score time.
Use cases: non-linear contextual regression with built-in variance estimation across trees; the natural backbone for Thompson-sampling contextual bandits. Reach for DecisionTreeRegressionStat alone when a single tree's predictions suffice and ensembled diversity isn't needed.
Memory: O(nbrTrees · single-tree memory); see DecisionTreeRegressionStat. Heavier but parallelisable.
Update: O(nbrTrees · depth) per observation; each tree's update is independent. Under bagging = true, each tree applies a fresh Poisson(1)-reweighted version of the update.
Concurrency: Inherits DecisionTreeRegressionStat's per-tree concurrency model. Trees are updated sequentially within a single update() call (no inner parallelism); concurrent callers each contend for each tree's split lock independently.
Constructors
RandomForestRegressionStat
Properties
bagging
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
RegressionTreeConfig with RegressionTreeConfig.mtry defaulted to ceil(sqrt(p)) when null.
featureSize
Number of features expected in x on each update. Mismatched lengths throw.
nbrTrees
splitCandidates
Candidate split pool. Used by every tree; the per-leaf mtry filter draws from here.
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.
findLeaves
Live leaves reached by x, in tree order; validates the feature dimension.
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.
predict
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
trees
Live underlying trees. Use for inspection.
validateMerge
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.