Learn R Programming

h2o (version 2.8.4.4)

h2o.loadModel: Load a H2O Model.

Description

Load a H2OModel object from disk that was saved using h2o.saveModel.

Usage

h2o.loadModel(object, path = "")

Arguments

object
An H2OClient object containing the IP address and port of the server running H2O.
path
The path of the H2O model file to be imported.

Value

  • Returns a H2OModel object of the class corresponding to the type of model built. Ex: A saved model built using GLM will return a H2OGLMModel object.

See Also

h2o.saveModel,h2o.saveAll, h2o.loadAll, H2OModel

Examples

Run this code
library(h2o)
localH2O = h2o.init()
prosPath = system.file("extdata", "prostate.csv", package = "h2o")
prostate.hex = h2o.importFile(localH2O, path = prosPath, key = "prostate.hex")
prostate.glm = h2o.glm(y = "CAPSULE", x = c("AGE","RACE","PSA","DCAPS"), 
  data = prostate.hex, family = "binomial", nfolds = 10, alpha = 0.5)
glmmodel.path = h2o.saveModel(object = prostate.glm, dir = "/Users/UserName/Desktop")
glmmodel.load = h2o.loadModel(localH2O, glmmodel.path)

Run the code above in your browser using DataLab