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, XGBoost, Isolation Forest).

Parameters:
  • model – The model this tree is related to.
  • tree_number – An integer representing the order in which the tree has been built in the model.
  • tree_class – A string representing the name of the tree’s class. The number of tree classes equals the number of levels in categorical response column. As there is exactly one class per categorical level, the name of the tree’s class is equal to the corresponding categorical level of the response column. In case of regression and binomial models, the name of the categorical level is ignored and can be omitted, as there is exactly one tree built in both cases.
Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.model_id
>>> tree.tree_number
>>> tree.tree_class
descriptions

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.descriptions
features

Names of the feature/column used for the split.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.features
left_children

An array with left child nodes of tree’s nodes.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.left_children
levels

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.levels
model_id

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.model_id
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.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.nas
node_ids

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.node_ids
predictions

Values predicted on tree’s nodes.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.predictions
right_children

An array with right child nodes of tree’s nodes.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.right_children
root_node

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.root_node
show()[source]

Summarizes the H2OTree.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.show()
thresholds

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.thresholds
tree_class

The name of a tree’s class.

The number of tree classes equals the number of levels in the categorical response column. As there is exactly one class per categorical level, the name of tree’s class is equal to the corresponding categorical level of the response column.

In the 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.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.tree_class
tree_number

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

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.tree_number

H2O Node Class

class h2o.tree.H2ONode(node_id)[source]

Bases: object

Represents a single abstract node in an H2OTree

Parameters:id – Node’s unique identifier (integer). Generated by H2O.
Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2ONode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines= h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0 , "NO")
>>> tree.node_ids
id

Node’s unique identifier (integer). Generated by H2O.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2ONode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines= h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/allyears2k_headers.zip")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> tree.node_ids
>>> node0 = H2ONode(0)
>>> node0

H2O Leaf Node Class

class h2o.tree.H2OLeafNode(node_id, prediction)[source]

Bases: h2o.tree.tree.H2ONode

Represents a single terminal node in an H2OTree with final prediction.

Parameters:
  • id – Node’s unique identifier (integer). Generated by H2O.
  • prediction – The prediction value in the terminal node (numeric floating point).
Examples:
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OLeafNode
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
# Retrieve the node ids      
>>> tree = H2OTree(gbm, 0, "NO")
>>> tree.node_ids
# Retrieve the predictions
>>> tree.predictions
# Set the id and prediction
>>> H2OLeafNode(0, -0.23001842)
id

Node’s unique identifier (integer). Generated by H2O.

Examples:
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OLeafNode
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
# Retrieve the node ids      
>>> tree = H2OTree(gbm, 0, "NO")
>>> tree.node_ids
# Retrieve the predictions
>>> tree.predictions
# Set the id and prediction
>>> leaf_node = H2OLeafNode(0, -0.23001842)
# Retrieve the node id
>>> leaf_node.id        
prediction

Prediction value in the terminal node (numeric floating point)

Examples:
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OLeafNode
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
# Retrieve the node ids      
>>> tree = H2OTree(gbm, 0, "NO")
>>> tree.node_ids
# Retrieve the predictions
>>> tree.predictions
# Set the id and prediction
>>> leaf_node = H2OLeafNode(0, -0.23001842)
# Retrieve the node prediction
>>> leaf_node.prediction
show()[source]
Examples:
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OLeafNode
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin", "Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
# Retrieve the predictions
>>> tree = H2OTree(gbm, 0, "NO")
>>> tree.predictions
# Retrieve predicted value for a node
>>> leaf_node = H2OLeafNode(0, -0.23001842)
>>> leaf_node.show()

H2O Split Node Class

class h2o.tree.H2OSplitNode(node_id, threshold, left_child, right_child, split_feature, na_direction, left_levels, right_levels)[source]

Bases: h2o.tree.tree.H2ONode

Represents a single node with either numerical or categorical split in an H2OTree with all its attributes.

Parameters:
  • id – Node’s unique identifier (integer). Generated by H2O.
  • threshold – Split threshold, typically when the split column is numerical.
  • left_child – Integer identifier of the left child node, if there is any. Otherwise None.
  • right_child – Integer identifier of the right child node, if there is and. Otherwise None.
  • split_feature – The name of the column this node splits on.
  • na_direction – The direction of NA values. LEFT means NA values go to the left child node, RIGHT means NA values go to the right child node. A value of None means occurence of NA for the given split column is not possible on this node due to an earlier split on the very same feature.
  • left_levels – Categorical levels on the edge from this node to the left child node. None for non-categorical splits.
  • right_levels – Categorical levels on the edge from this node to the right cild node. None for non-categorical splits.
Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> H2OSplitNode(5, threshold, left_child,
...              right_child, split_feature,
...              na_direction, left_levels,
...              right_levels)
id

Node’s unique identifier (integer). Generated by H2O.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.id
left_child

Integer identifier of the left child node, if there is any. Otherwise None.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.left_child
left_levels

Categorical levels on the edge from this node to the left child node. None for non-categorical splits.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.left_levels
na_direction

The direction of NA values. LEFT means NA values go to the left child node, RIGH means NA values go to the right child node. A value of None means occurance of NA for the given split column is not possible on this node due to an earlier split on the very same feature.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.na_direction
right_child

Integer identifier of the right child node, if there is any. Otherwise None.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.right_child
right_levels

Categorical levels on the edge from this node to the right child node. None for non-categorical splits.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.right_levels
show()[source]
Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.show
split_feature

The name of the column this node splits on.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.split_feature
threshold

Split threshold, typically when the split column is numerical.

Examples:
>>> from h2o.tree import H2OTree
>>> from h2o.tree import H2OSplitNode
>>> from h2o.estimators import H2OGradientBoostingEstimator
>>> airlines = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/airlines/AirlinesTrain.csv")
>>> gbm = H2OGradientBoostingEstimator(ntrees=1)
>>> gbm.train(x=["Origin","Dest"],
...           y="IsDepDelayed",
...           training_frame=airlines)
>>> tree = H2OTree(gbm, 0, "NO")
>>> threshold = 'nan'
>>> left_child = 9
>>> right_child = 10
>>> split_feature = "DepTime"
>>> na_direction = "Left"
>>> left_levels = ['FAT', 'LAS', 'PSP']
>>> right_levels = ['BWI', 'CLT', 'IND', 'MCO',
...                 'PHL', 'PHX', 'RIC', 'TPA']
>>> split_node = H2OSplitNode(5, threshold, left_child,
...                           right_child, split_feature,
...                           na_direction, left_levels,
...                           right_levels)
>>> split_node.threshold