Learn R Programming

h2o (version 2.8.4.4)

h2o.saveAll: Save all H2OModel objects to disk.

Description

Save all H2OModel objects to a disk and can be loaded back into H2O using h2o.loadModel or h2o.loadAll.

Usage

h2o.saveAll(object, dir="", save_cv = TRUE, force=FALSE)

Arguments

object
An H2OClient object.
dir
Directory the model files will be written to.
save_cv
(Optional) If save_cv = TRUE all associated cross validation will be saved in the same base directory as the main model. If you don't save cross validation models, there will be warnings when loading the model.
force
(Optional) If force = TRUE any existing file will be overwritten. Otherwise if the file already exists the operation will fail.

Value

  • Returns paths of model objects saved.

See Also

h2o.saveModel,h2o.loadAll, h2o.loadModel, H2OModel

Examples

Run this code
library(h2o)
localH2O = h2o.init()
prostate.hex = h2o.importFile(localH2O, path = paste("https://raw.github.com", 
  "h2oai/h2o/master/smalldata/logreg/prostate.csv", sep = "/"), 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.saveModel(object = prostate.glm, dir = "/Users/UserName/Desktop", save_cv = TRUE, force = TRUE)
h2o.saveAll(object = localH2O, dir = "/Users/UserName/Desktop", save_cv = TRUE, force = TRUE)

Run the code above in your browser using DataLab