0

I keep encountering errors when I'm trying to plot trees from h2o.download_mojo(). I followed the official instructions:

# Now download the latest stable h2o release from http://www.h2o.ai/download/
# and run the PrintMojo tool from the command line.
#
# (For MacOS: brew install graphviz)
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

I've made sure I use the latest stable h2o and graphviz installed, while I keep getting this error:

java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i model.zip -o model.gv -f 20 -d 3
Error: Could not find or load main class hex.genmodel.tools.PrintMojo

dot -Tpng model.gv -o model.png
Error: dot: can't open model.gv

I'm not familiar with java. It will be great if somebody can help me with this. Thanks very much!

EmLp
  • 13
  • 6

2 Answers2

0

Looks like when you pasted the command, you missed the java - part

lakeskysea
  • 591
  • 3
  • 8
  • 15
  • java -cp h2o.jar hex.genmodel.tools.PrintMojo --tree 0 -i model.zip -o model.gv -f 20 -d 3 Error: Could not find or load main class hex.genmodel.tools.PrintMojo – EmLp Oct 30 '18 at 19:43
  • Sorry, my bad. But after I add it, it gives me another error as "Could not find or load main class hex.genmodel.tools.PrintMojo" – EmLp Oct 30 '18 at 19:43
0

Adding answer to your follow up question that you posed in response to lakeskysea's answer.

If you are seeing the error "Could not find or load main class hex.genmodel.tools.PrintMojo"

It is likely because you have an old version of H2O, The PrintMojo functionality wasn't added until after version 3.10.4. Please verify that you are using a version of H2O-3 that has the PrintMojo ability.

(and just in case, please also double check that you have graphviz install with dot -V)

Lauren
  • 5,640
  • 1
  • 13
  • 19
  • I get the same error. I checked my H2o version and its "3.22.0.1". should I install graphviz in R as a separate package? – Rio Feb 22 '19 at 15:44