kumulant

ClassificationTree

class ClassificationTree(numClasses: Int, splitCandidates: List<Split>, config: ClassificationTreeConfig = ClassificationTreeConfig(), concurrency: Concurrency = Concurrency.None, leafArmFactory: () -> SeriesStat<ClassCountsResult> = { ClassCountsStat(numClasses, concurrency) }, randomSeed: Int = 0)(source)

Classification mirror of RegressionTree: online VFDT decision tree where each leaf carries a per-class count accumulator and audit leaves track class counts per candidate split. Splits fire when a candidate clears the Hoeffding bound on the configured ClassificationSplitMetric (Gini or information gain).

Concurrency model matches RegressionTree: lock-free leaf updates, single split-conversion lock fired only at split-decision time.

Constructors

Link copied to clipboard
constructor(numClasses: Int, splitCandidates: List<Split>, config: ClassificationTreeConfig = ClassificationTreeConfig(), concurrency: Concurrency = Concurrency.None, leafArmFactory: () -> SeriesStat<ClassCountsResult> = { ClassCountsStat(numClasses, concurrency) }, randomSeed: Int = 0)

Properties

Link copied to clipboard

Number of internal + leaf nodes currently in the tree.

Functions

Link copied to clipboard

Walk to the leaf row resolves to.

Link copied to clipboard

Structurally merge other into this tree; other is consumed.

Link copied to clipboard

Snapshot merge: same rules as merge but the other side is an immutable result.

Link copied to clipboard

Argmax class at the leaf row resolves to.

Link copied to clipboard
fun prettyPrint(indent: String = ""): String

Render the tree as nested if-else text.

Link copied to clipboard

Probabilities at the leaf row resolves to.

Link copied to clipboard
fun reset()

Reset to a single fresh leaf.

Link copied to clipboard

Live root node, for snapshotting.

Link copied to clipboard

Aggregate class-count snapshot at the root, walking leaves and split carryovers.

Link copied to clipboard
fun update(row: VectorView, classLabel: Int, weight: Double = 1.0)

Fold an observation (row, classLabel) into the tree, possibly growing it.

ClassificationTree

constructor(numClasses: Int, splitCandidates: List<Split>, config: ClassificationTreeConfig = ClassificationTreeConfig(), concurrency: Concurrency = Concurrency.None, leafArmFactory: () -> SeriesStat<ClassCountsResult> = { ClassCountsStat(numClasses, concurrency) }, randomSeed: Int = 0)(source)

findLeaf

Walk to the leaf row resolves to.

mergeSnapshot

Snapshot merge: same rules as merge but the other side is an immutable result.

merge

Structurally merge other into this tree; other is consumed.

nodeCount

Number of internal + leaf nodes currently in the tree.

predict

Argmax class at the leaf row resolves to.

prettyPrint

fun prettyPrint(indent: String = ""): String(source)

Render the tree as nested if-else text.

probabilities

Probabilities at the leaf row resolves to.

reset

fun reset()(source)

Reset to a single fresh leaf.

rootNode

Live root node, for snapshotting.

rootSnapshot

Aggregate class-count snapshot at the root, walking leaves and split carryovers.

update

fun update(row: VectorView, classLabel: Int, weight: Double = 1.0)(source)

Fold an observation (row, classLabel) into the tree, possibly growing it.