h2o (version 3.32.0.1)

h2o.upload_mojo: Imports a MOJO from a local filesystem, creating a Generic model with it.

Description

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

Usage

h2o.upload_mojo(mojo_local_file_path)

Arguments

mojo_local_file_path

Filesystem path to the model imported

Value

Returns H2O Generic Model embedding given MOJO model

Examples

Run this code
# 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_name <- h2o.download_mojo(model = original_model, path = tempdir())
mojo_original_path <- paste0(tempdir(), "/", mojo_original_name)

# Upload the MOJO from local filesystem and obtain a Generic model
mojo_model <- h2o.upload_mojo(mojo_original_path)

# Perform scoring with the generic model
predictions  <- h2o.predict(mojo_model, data)
# }

Run the code above in your browser using DataCamp Workspace