H2O-3 Secure provides the supported, production-grade path for deploying models. Contact enterprise@h2o.ai.
About POJOs and MOJOs
H2O allows you to convert the models you have built to either a Plain Old Java Object (POJO) or a Model ObJect, Optimized (MOJO).
H2O-generated MOJO and POJO models are intended to be easily embeddable in any Java environment. The only compilation and runtime dependency for a generated model is the h2o-genmodel.jar file produced as the build output of these packages. This file is a library that supports scoring. For POJOs, it contains the base classes from which the POJO is derived from. (You can see "extends GenModel" in a POJO class. The GenModel class is part of this library.) For MOJOs, it also contains the required readers and interpreters. The h2o-genmodel.jar file is required when POJO/MOJO models are deployed to production.
Users can refer to the Quick Start topics that follow for more information about generating POJOs and MOJOs.
Developers can refer to the POJO and MOJO Model Javadoc.
See MOJO Quickstart and POJO Quickstart for step-by-step instructions.
Example design patterns
Here is a collection of example design patterns for how to productionize H2O.
Consumer loan application
| Characteristic | Value |
|---|
| Pattern name | Jetty servlet |
| Example training language | R |
| Example training data source | CSV file |
| Example scoring data source | User input to Javascript application running in browser |
| Scoring environment | REST API service provided by Jetty servlet |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Real-time |
Craigslist application
| Characteristic | Value |
|---|
| Pattern name | Sparkling water streaming |
| Example training language | Scala |
| Example training data source | CSV file |
| Example scoring data source | User input to Javascript application running in browser |
| Scoring engine | H2O cluster |
| Scoring latency SLA | Real-time |
Malicious domain application
| Characteristic | Value |
|---|
| Pattern name | AWS Lambda |
| Example training language | Python |
| Example training data source | CSV file |
| Example scoring data source | User input to Javascript application running in browser |
| Scoring environment | AWS Lambda REST API endpoint |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Real-time |
Storm bolt
| Characteristic | Value |
|---|
| Pattern name | Storm bolt |
| Example training language | R |
| Example training data source | CSV file |
| Example scoring data source | Storm spout |
| Scoring environment | POJO embedded in a Storm bolt |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Real-time |
Invoking POJO directly in R
| Characteristic | Value |
|---|
| Pattern name | POJO in R |
| Example training language | R |
| Example training data source | (Need example) |
| Example scoring data source | (Need example) |
| Scoring environment | R |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Batch |
Hive UDF
| Characteristic | Value |
|---|
| Pattern name | Hive UDF |
| Example training language | R |
| Example training data source | HDFS directory with hive part files output by a SELECT |
| Example scoring data source | Hive |
| Scoring environment | Hive SELECT query (parallel MapReduce) running UDF |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Batch |
MOJO as a JAR resource
| Characteristic | Value |
|---|
| Pattern name | MOJO JAR |
| Example training language | R |
| Example training data source | Iris |
| Example scoring data source | Single Row |
| Scoring environment | Portable |
| Scoring engine | H2O MOJO |
| Scoring latency SLA | Real-time example, but can be adapted (use in Hive UDF etc.) |
Steam scoring server from H2O.ai
| Characteristic | Value |
|---|
| Pattern name | Steam |
| Scoring data source | REST API client |
| Scoring environment | Steam scoring server |
| Scoring engine | H2O POJO |
| Scoring latency SLA | Real-time |
Scoring server on AWS
You can deploy a RESTful server on AWS using the marketplace AMI (H2O Inference server - Hourly). Notice that this is a paid AMI.
Transfer the MOJO file into the /tmp folder of this instance before launching. If your MOJO is in S3, assign a role that provides S3 access to the instance.
Run following bash script as "userdata" to transfer your MOJO into the instance before you launch the instance. Be sure you change the mojofile path below.
export mojofile="s3://yourbucket/yourmojo.zip"
aws s3 cp $mojofile /tmp/pipeline.mojo
After this instance has launched, you can make real time inference using the following command. Remember to change the IP address. Input data is provided through the row parameter in the URL.
curl "http://<yourIP>:8080/model?type=1&row=2000,2000"
Additional resources