How to visualize H2O Tree?

蓝咒 提交于 2019-12-13 04:27:05

问题


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

and trained my model with

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

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


回答1:


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


来源:https://stackoverflow.com/questions/56938966/how-to-visualize-h2o-tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!