Both of root node’s children also have child nodes and thus have a split feature assigned. As the tree is binary, root node has two child nodes with index 1 and 2. Index 0 is the root node and it splits on feature Origin. As the depth of the tree is limited to 3, the array below makes perfect sense. As there is only one feature in the example model named Origin, all the split features are the same. If the value is None, the node is terminal. Each index represents a node and a feature the node splits on. In the following example, an array of split features is printed. As there are multiple arrays, only those holding the information required may be accessed.
As each node is visited only once, the complexity of this task is O(n). By iterating from 0 to len(tree), all the information available can be extracted. Length of these arrays alway equals to the number of nodes in the tree. predictions provides information about prediction on given nodes (if applicable).nas array holds information about NA value direction (left node, right node, none/unavailable),.levels show list of categorical levels inherited by each node from parent (if any),.features array tells which feature is used for split on given node ,.thresholds provide split threshold for each node,.descriptions holds a human-readable description of each node,.node_ids provides node’s unique identifier inside H2O (may differ from index),.right_children holds indices of node’s right child,.left_children holds indices of node’s left child,.Each array holds different kinds of information about nodes. 9.453938 Iteration Through Node-Info ArraysĪ second way to obtain information about tree’s nodes are arrays built in to H2OTree object type. first_tree.root_node.left_child.right_child.idįirst_tree.root_node.left_child.right_child.prediction Tree = H2OTree(model = airlines_model, tree_number = 0, tree_class = None)Ī leaf node (type H2OLeafNode) lacks the properties regarding column split, but contains a prediction-related information instead:Īccess to H2OLeafNode’s properties is demonstrated in the next figure. Obtaining a tree is a matter of a single API call both in Python from h2o.tree import H2OTree As long as a model is not deleted trees can be fetched using Python and R. The ability to fetch and inspect each tree separately is a crucial part of the API. H 2O tree-based algorithms produce many trees during the training process. For beginners, there is an introductory article called Machine Learning With H2O - Hands-On Guide for Data Scientists.
CMH CONSTRUCTOR VIEWER HOW TO
There is a user guide with instructions on how to install the newest version of H 2O available on H 2O documentation page. A complete version of this API with support for all the algorithms is available since version 3.22.0.1, codename xia (named after Zhihong Xia. As a part of H 2O’s strategy of explainable AI, an API has been built to allow data scientists to inspect decision trees built while training the above-mentioned algorithms. In addition, algorithms like GBM or XGBoost may be part of Stacked Ensembles models or leveraged by AutoML.
We’ve created unified API to access every single tree in all tree-based algorithms available in H 2O, namely: Missing required parameters for [URI: site/ in /var/#2 Illuminate\Pipeline\Pipeline:then in /var/In the latest stable release, we’ve made it possible for data scientists and developers to inspect the trees thoroughly.