v2026.11.0
All Bundles
Bundle

Core machine learning types: the seedable Random generator, Matrix2D linear algebra and activations, matrix reference holders, the NeuralNetwork and CSV-backed MatrixReader. Compile with -lib ml.

RegressionTreeNode

A node in a RegressionTree: either a leaf carrying a mean prediction, or an internal node splitting a numeric feature at a threshold (<= left).

Operations

GetId #

A leaf's index within its tree.

method : public : GetId() ~ Int

Return

TypeDescription
Intleaf index; 0 for a node never numbered

NewInternal # function

Creates an internal split node.

function : NewInternal(feature:Int, threshold:Float) ~ RegressionTreeNode

Parameters

NameTypeDescription
featureIntfeature index to split on
thresholdFloatsplit threshold (<= goes left)

Return

TypeDescription
RegressionTreeNodeinternal node

NewLeaf # function

Creates a leaf node.

function : NewLeaf(value:Float) ~ RegressionTreeNode

Parameters

NameTypeDescription
valueFloatmean target the leaf predicts

Return

TypeDescription
RegressionTreeNodeleaf node

SetId #

Sets a leaf's index within its tree (DecisionTreeClassifier numbers its leaves in the order it creates them).

method : public : SetId(id:Int) ~ Nil

Parameters

NameTypeDescription
idIntleaf index