Learn R Programming

h2o (version 2.8.4.4)

h2o.loadAll: Load all H2O Model in a directory.

Description

Load all H2OModel object in a directory from disk that was saved using h2o.saveModel or h2o.saveAll.

Usage

h2o.loadAll(object, dir = "")

Arguments

object
An H2OClient object containing the IP address and port of the server running H2O.
dir
The directory multiple H2O model files to be imported from.

Value

  • Returns H2OModel objects 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.loadModel, 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)
prostate.gbm = h2o.gbm(y = "CAPSULE", x = c("AGE","RACE","PSA","DCAPS"), n.trees=3,
  interaction.depth=1, distribution="multinomial", data = prostate.hex)
h2o.saveAll(object = localH2O, dir = "/Users/UserName/Desktop", save_cv = TRUE, force = TRUE)  
h2o.removeAll(object = conn)
model.load = h2o.loadModel(localH2O, dir = "/Users/UserName/Desktop")
prostate.glm = model.load[[1]]
prostate.gbm = model.load[[2]]

Run the code above in your browser using DataLab