如何可视化H2O树? [英] How to visualize H2O Tree?

查看:104
本文介绍了如何可视化H2O树?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有df data_categorical 和一个模型 model

我将df转换为

data = h2o的h2o框架。H2OFrame(data_categorical)

I have df data_categorical and a model model.
I converted my df to h2o frame with
data = h2o.H2OFrame(data_categorical)

并训练了我的模型

model = H2ORandomForestEstimator(ntrees=1, max_depth=20, nfolds=10)
# Train model
model.train(x=training_columns, y=response_column, training_frame=train) 

我是试图可视化所创建的树(请注意,我只需要一棵树),但似乎无法做到这一点。

我用

<$ c下载了mojo文件$ c> model.download_mojo(path,get_genmodel_jar = True)

但我不知道下一步该做什么

I'm trying to visualize the tree that is created (note that I only need one tree) but I can't seem to do that.
I downloaded the mojo file with
model.download_mojo(path,get_genmodel_jar=True)
But I don't know what to do next

推荐答案

您可以使用以下文档中描述的工作流程:

You can use the workflow described in the documentation below:

  • http://docs.h2o.ai/h2o/latest-stable/h2o-genmodel/javadoc/overview-summary.html#viewing-a-mojo
java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i model.zip -o model.gv -f 20 -d 3
dot -Tpng model.gv -o model.png
open model.png

这篇关于如何可视化H2O树?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆