Skip to content

How to import H20 to Mojo PMML

Overview

To register a model built using H2O libraries in the platform, user needs to convert the model into MOJO. Post conversion of the Model into MOJO this can be directly registered in the Platform or can be converted to PMML to be registered in the platform.

Convert H2O to Mojo
  • Download model in model object optimized data format (MOJO) to file on local drive using following commands

    gbm=H2OGradientBoostingEstimator(ntrees=300)
    gbm.train(x = features,y = dv,training_frame=df_h2o )
    gbm.download_mojo(path)
    
  • Path is the location of the downloaded MOJO file

  • To convert MOJO to pmml, third party jar file from github is used in the command file to extract the pmml

    • Converting the MOJO file mojo.zip to a PMML file mojo.pmml

      java-jar jpmml-h2o-executable-1.1-SNAPSHOT.jar -mojo-input gbmmodel_regression.zip --pmml-output gbm.pmml
      
  • Use the same file while registering the model on the Platform. Refer Registering a Model section to register the model.