问题
I have df data_categorical
and a model model
.
I converted my df to h2o frame withdata = 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 withmodel.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