Skip to content

LeafBuilder Class#

LeafBuilder #

LeafBuilder(X, Y, all_idx, **kwargs)

The base LeafBuilder class from which all other leaf builders must inherit.

Parameters:

Name Type Description Default
X ndarray

The feature values used for training.

required
Y ndarray

The response values used for training.

required
all_idx ndarray

A vector specifying samples of the training data that should be considered by the LeafBuilder.

required

build_leaf #

build_leaf(leaf_id, indices, depth, impurity, weighted_samples, parent)

Builds a leaf node.

Parameters:

Name Type Description Default
leaf_id int

unique identifier of leaf node

required
indices ndarray

indices in leaf node

required
depth int

depth of leaf node

required
impurity float

impurity of leaf node

required
weighted_samples float

summed weight of all samples in the LeafNode

required
parent DecisionNode

parent node

required

Returns:

Type Description
Node

built leaf node