h2o (version 3.2.0.3)

h2o.grid: H2O Grid Support

Description

Provides a set of functions to launch a grid search and get its results.

Usage

h2o.grid(algorithm, grid_id, ..., hyper_params = list(),
  is_supervised = NULL, do_hyper_params_check = FALSE,
  conn = h2o.getConnection())

Arguments

algorithm
name of algorithm to use in grid search (gbm, randomForest, kmeans, glm, deeplearning, naivebayes, pca)
grid_id
optional id for resulting grid search, if it is not specified then it is autogenerated
...
arguments describing parameters to use with algorithm (i.e., x, y, training_frame). Look at the specific algorithm - h2o.gbm, h2o.glm, h2o.kmeans, h2o.deepLearning
hyper_params
list of hyper parameters (i.e., list(ntrees=c(1,2), max_depth=c(5,7)))
is_supervised
if specified then override default heuristing which decide if given algorithm name and parameters specify super/unsupervised algorithm.
do_hyper_params_check
perform client check for specified hyper parameters. It can be time expensive for large hyper space
conn
connection to H2O cluster

Details

Launch grid search with given algorithm and parameters.

Examples

Run this code
library(h2o)
library(jsonlite)
localH2O <- h2o.init()
iris.hex <- as.h2o(iris)
grid <- h2o.grid("gbm", x = c(1:4), y = 5, training_frame = iris.hex,
                 hyper_params = list(ntrees = c(1,2,3)))
# Get grid summary
summary(grid)
# Fetch grid models
model_ids <- grid@model_ids
models <- lapply(model_ids, function(id) { h2o.getModel(id)})

Run the code above in your browser using DataLab