h2o.import_mojo function

Imports a MOJO under given path, creating a Generic model with it.

Imports a MOJO under given path, creating a Generic model with it.

Usage example: mojo_model <- h2o.import_mojo(model_file_path = "/path/to/mojo.zip") predictions <- h2o.predict(mojo_model, dataset)

h2o.import_mojo(mojo_file_path, model_id = NULL)

Arguments

  • mojo_file_path: Filesystem path to the model imported
  • model_id: Model ID, default is NULL

Returns

Returns H2O Generic Model embedding given MOJO model

Examples

## Not run: # Import default Iris dataset as H2O frame data <- as.h2o(iris) # Train a very simple GBM model features <- c("Sepal.Length", "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") original_model <- h2o.gbm(x = features, y = "Species", training_frame = data) # Download the trained GBM model as MOJO (temporary directory used in this example) mojo_original_path <- h2o.save_mojo(original_model, path = tempdir()) # Import the MOJO and obtain a Generic model mojo_model <- h2o.import_mojo(mojo_original_path) # Perform scoring with the generic model predictions <- h2o.predict(mojo_model, data) ## End(Not run)
  • Maintainer: Tomas Fryda
  • License: Apache License (== 2.0)
  • Last published: 2024-01-11