Tree Class in H2O

H2O Tree Class

class h2o.tree.H2OTree(model, tree_number, tree_class=None)[source]

Bases: object

Represents a model of a Tree built by one of H2O’s algorithms (GBM, Random Forest).

descriptions

Descriptions for each node to be found in the tree. Contains split threshold if the split is based on numerical column. For cactegorical splits, it contains list of categorical levels for transition from the parent node.

features

Names of the feature/column used for the split.

left_children

An array with left child nodes of tree’s nodes

levels

Categorical levels on split from parent’s node belonging into this node. None for root node or non-categorical splits.

model_id

Name (identification) of the model this tree is related to.

nas

representing if NA values go to the left node or right node. The value may be None if node is a leaf or there is no possibility of an NA value appearing on a node.

node_ids

Array with identification numbers of nodes. Node IDs are generated by H2O.

predictions

Values predicted on tree’s nodes.

right_children

An array with right child nodes of tree’s nodes

root_node

An instance of H2ONode representing the beginning of the tree behind the model. Allows further tree traversal.

show()[source]
thresholds

Node split thresholds. Split thresholds are not only related to numerical splits, but might be present in case of categorical split as well.

tree_class

The name of a tree’s class. Number of tree classes equals to the number of levels in categorical response column.

As there is exactly one class per categorical level, name of tree’s class equals to the corresponding
categorical level of response column.
In case of regression and binomial, the name of the categorical level is ignored can be omitted,
as there is exactly one tree built in both cases.
tree_number

The order in which the tree has been built in the model.