automatically saving many model jsons

40 views
Skip to first unread message

simonf...@gmail.com

unread,
May 14, 2015, 10:56:22 AM5/14/15
to h2os...@googlegroups.com
Hi,

First, thank you, I really love your product.

I would like to know how/whether it is possible to automatically download many large random forest models created in h2o. Use case is: I create many random forest classifiers through rh2o by an automated process. I want to download these as model jsons, so that I can then reload them and run them in scala on a separate system.

Further, the number and size of models is such that I currently need to delete them (h2o.rm) in the loop to keep within my allocated h2o memory. So I would like to export the jsons on the fly.

Any and all suggestions are welcome.

Thank you!



Tom Kraljevic

unread,
May 14, 2015, 11:45:20 AM5/14/15
to simonf...@gmail.com, h2os...@googlegroups.com

Hi Simon,


This is an interesting case.

H2O does not export models in json today. It exports models as POJOs for easy general embedding and it exports models as opaque binary for reloading into h2o (although this is not quite yet implemented in h2o-dev, but will be very soon).

To re-import them inside Scala, you could go with the approach of instantiating a POJO and calling it directly. Or, you could go with the approach of instantiating a "live" h2o-dev cluster inside your Scala app and loading the binary model data (once this is supported in h2o-dev).

(Note that if the RF model itself is enormous, that can be an indication it is overtrained, especially with RF.)


Tom
> --
> You received this message because you are subscribed to the Google Groups "H2O & Open Source Scalable Machine Learning - h2ostream" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to h2ostream+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Simon Fuller

unread,
May 15, 2015, 3:45:36 AM5/15/15
to Tom Kraljevic, h2os...@googlegroups.com
Hi Tom,

Exporting as POJOs works pretty well for now.

Thanks!

Simon

russ.b...@gmail.com

unread,
Sep 15, 2015, 10:54:12 AM9/15/15
to H2O Open Source Scalable Machine Learning - h2ostream, simonf...@gmail.com
Does h2o-3 / dev support exporting models in binary form yet?

Prithvi Prabhu

unread,
Sep 15, 2015, 12:50:57 PM9/15/15
to russ.b...@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream, simonf...@gmail.com
Yes, you can call the /99/Models.bin/model-name to import/export models.
Warning: this particular API is in flux.

GET /99/Models.bin/model-name?dir=path-to-export-to&force=true will export a model to "dir"
POST /99/Models.bin/model-name with parameters "dir" and "force" will import a model from "dir"


On Tue, Sep 15, 2015 at 7:54 AM <russ.b...@gmail.com> wrote:
Does h2o-3 / dev support exporting models in binary form yet?

--
You received this message because you are subscribed to the Google Groups "H2O Open Source Scalable Machine Learning  - h2ostream" group.
Reply all
Reply to author
Forward
0 new messages