DecisionTreeClassifierStat
Online VFDT decision-tree classifier; the classification counterpart of DecisionTreeRegressionStat. Each leaf carries a ClassCountsResult (per-class weighted counts); splits fire when a candidate beats the runner-up by the Hoeffding bound on Gini reduction or information gain.
Input is fed through RegressionStat: x is the feature vector, y is the class index in [0, numClasses), resolved by asClassLabel.
Use cases: online classification where the decision boundary is axis-aligned and piecewise constant, and the model must grow with the stream rather than be refit. Reach for RandomForestClassifierStat for ensembled diversity, or DecisionTreeRegressionStat when the target is continuous.
Memory: O(nodes · splitCandidates); a ClassCountsStat per node plus per-audit-leaf candidate accumulators. Bounded by ClassificationTreeConfig.maxNodes.
Update: O(depth) per observation; a tree walk to the destination leaf, then a leaf-arm update. Splits fire at most once every ClassificationTreeConfig.splitPeriod observations per audit leaf.
Concurrency: Inherits DecisionTreeRegressionStat's concurrency model, with ClassCountsStat leaf arms in place of variance accumulators. The update path touches exactly one leaf, so threads landing in different leaves never contend; split conversion takes a per-tree lock fired only at split decisions. See ClassificationTree for the full design.
Constructors
DecisionTreeClassifierStat
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 ClassificationTree.
featureSize
Number of features expected in x on each update. Mismatched lengths throw.
numClasses
Number of classes; the input y must round to [0, numClasses).
splitCandidates
Candidate splits considered at every audit leaf.
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 classification tree. Use for inspection / pretty-printing.
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.