get_split_expressions: Get split conditions for edges in tree

Description Usage Arguments Value Examples

Description

This function manipulates the output of H2OTreeConvertR::h2o_tree_convertR to get the split condition for each edge in a tree

Usage

1

Arguments

h2o_tree_R

a sinlge data.frame output from H2OTreeConvertR::h2o_tree_convertR.

Value

data.frame containing left and right split conditions for parent nodes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(h2o)

h2o.init()

prostate.hex = h2o.uploadFile(path = system.file("extdata",
                                                 "prostate.csv",
                                                 package = "h2o"),
                              destination_frame = "prostate.hex")

prostate.hex$RACE <- as.factor(prostate.hex$RACE)

prostate.hex$DPROS <- as.factor(prostate.hex$DPROS)

prostate.gbm = h2o.gbm(x = c("AGE", "RACE", "DPROS", "DCAPS", "PSA", "VOL", "GLEASON"),
                       y = "CAPSULE",
                       training_frame = prostate.hex,
                       ntrees = 5,
                       max_depth = 5,
                       learn_rate = 0.1)

h2o_trees <- H2OTreeConvertR::h2o_tree_convertR(prostate.gbm)

tree_1_split_expr <- get_split_expressions(h2o_trees[[1]])

richardangell/h2oTreeHelpR documentation built on July 3, 2019, 7:35 a.m.