h2o.getFrame: Get an R Reference to an H2O Dataset, that will NOT be GC'd...

View source: R/kvstore.R

h2o.getFrameR Documentation

Get an R Reference to an H2O Dataset, that will NOT be GC'd by default

Description

Get the reference to a frame with the given id in the H2O instance.

Usage

h2o.getFrame(id)

Arguments

id

A string indicating the unique frame of the dataset to retrieve.

Examples

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

f <- "https://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_train.csv"
train <- h2o.importFile(f)
y <- "species"
x <- setdiff(names(train), y)
train[, y] <- as.factor(train[, y])
nfolds <- 5
num_base_models <- 2
my_gbm <- h2o.gbm(x = x, y = y, training_frame = train, 
                  distribution = "multinomial", ntrees = 10, 
                  max_depth = 3, min_rows = 2, learn_rate = 0.2, 
                  nfolds = nfolds, fold_assignment = "Modulo", 
                  keep_cross_validation_predictions = TRUE, seed = 1)
my_rf <- h2o.randomForest(x = x, y = y, training_frame = train, 
                          ntrees = 50, nfolds = nfolds, fold_assignment = "Modulo", 
                          keep_cross_validation_predictions = TRUE, seed = 1)
stack <- h2o.stackedEnsemble(x = x, y = y, training_frame = train, 
                             model_id = "my_ensemble_l1", 
                             base_models = list(my_gbm@model_id, my_rf@model_id), 
                             keep_levelone_frame = TRUE)
h2o.getFrame(stack@model$levelone_frame_id$name)

## End(Not run)

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