h2o.loadGrid: Loads previously saved grid with all it's models from the...

View source: R/import.R

h2o.loadGridR Documentation

Loads previously saved grid with all it's models from the same folder

Description

Returns a reference to the loaded Grid.

Usage

h2o.loadGrid(grid_path, load_params_references = FALSE)

Arguments

grid_path

A character string containing the path to the file with the grid saved.

load_params_references

A logical which if true will attemt to reload saved objects referenced by grid parameters (e.g. training frame, calibration frame), will fail if grid was saved without referenced objects.

Examples

## Not run: 
library(h2o)
h2o.init()

iris <- as.h2o(iris)

ntrees_opts = c(1, 5)
learn_rate_opts = c(0.1, 0.01)
size_of_hyper_space = length(ntrees_opts) * length(learn_rate_opts)

hyper_parameters = list(ntrees = ntrees_opts, learn_rate = learn_rate_opts)
# Tempdir is chosen arbitrarily. May be any valid folder on an H2O-supported filesystem.
baseline_grid <- h2o.grid("gbm", grid_id="gbm_grid_test", x=1:4, y=5, training_frame=iris,
hyper_params = hyper_parameters, export_checkpoints_dir = tempdir())
# Remove everything from the cluster or restart it
h2o.removeAll()
grid <- h2o.loadGrid(paste0(tempdir(),"/",baseline_grid@grid_id))

## End(Not run)

h2o documentation built on May 29, 2024, 4:26 a.m.