kumulant

ClassCountsResult

@Serializable
@SerialName(value = "ClassCountsResult")
data class ClassCountsResult(val numClasses: Int, val counts: DoubleArray) : Result(source)

Snapshot of a K-bin weighted class-count vector. Used as the leaf aggregate for ClassificationTree: the per-leaf running tally of how many (weighted) observations of each class landed in this leaf. Exposes derived class probabilities and the argmax prediction.

Constructors

Link copied to clipboard
constructor(numClasses: Int, counts: DoubleArray)

Properties

Link copied to clipboard

Per-class accumulated weight; length numClasses.

Link copied to clipboard

Shannon entropy of the empirical class distribution, in nats. Zero on an empty leaf.

Link copied to clipboard

Gini impurity 1 - Sum p_k^2. Zero on a pure leaf or an empty leaf.

Link copied to clipboard

Number of classes.

Link copied to clipboard

Total weight summed across all classes.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun predict(): Int

Argmax class index; ties resolve to the lowest index.

Link copied to clipboard

Class probabilities; uniform when no observations have been seen yet.

ClassCountsResult

constructor(numClasses: Int, counts: DoubleArray)(source)

counts

Per-class accumulated weight; length numClasses.

entropy

Shannon entropy of the empirical class distribution, in nats. Zero on an empty leaf.

equals

open operator override fun equals(other: Any?): Boolean(source)

gini

Gini impurity 1 - Sum p_k^2. Zero on a pure leaf or an empty leaf.

hashCode

open override fun hashCode(): Int(source)

numClasses

Number of classes.

predict

Argmax class index; ties resolve to the lowest index.

probabilities

Class probabilities; uniform when no observations have been seen yet.

totalWeights

Total weight summed across all classes.