以rpart帧格式提取h2o随机林

以rpart帧格式提取h2o随机林,r,random-forest,h2o,R,Random Forest,H2o,以下代码: library(randomForest) z.auto <- randomForest(Mileage ~ Weight, data=car.test.frame, ntree=1, nodesize = 15) tree <- getTree(z.auto,k=1,labelVar = T) tree 库(随机林) z、 aut

以下代码:

library(randomForest)
z.auto <- randomForest(Mileage ~ Weight, 
                       data=car.test.frame,
                       ntree=1,
                       nodesize = 15)
tree <- getTree(z.auto,k=1,labelVar = T)
tree
库(随机林)

z、 autoH2O目前没有显示这样一个表的函数,但是您可以使用 下载_pojo()函数,然后手动检查树(单个规则)

H2O也接受

   left daughter right daughter split var split point status prediction
1              2              3    Weight      2567.5     -3   24.45000
2              0              0      <NA>         0.0     -1   30.66667
3              4              5    Weight      3087.5     -3   22.37778
4              6              7    Weight      2747.5     -3   24.00000
5              8              9    Weight      3637.5     -3   19.94444
6              0              0      <NA>         0.0     -1   25.20000
7             10             11    Weight      2770.0     -3   23.29412
8              0              0      <NA>         0.0     -1   21.18182
9              0              0      <NA>         0.0     -1   18.00000
10             0              0      <NA>         0.0     -1   22.50000
11             0              0      <NA>         0.0     -1   23.72727