Learn R Programming

h2o (version 2.8.4.4)

h2o.nFoldExtractor: Extract N-fold holdout splits from H2O Data Set

Description

Split an existing H2O data set into N folds and return a specified holdout split, and the rest.

Usage

h2o.nFoldExtractor(data, nfolds, fold_to_extract)

Arguments

data
An H2OParsedData object representing the dataset to split.
nfolds
A numeric value indicating the total number of folds created.
fold_to_extract
A numeric value indicating which fold to hold out.

Value

  • Returns a list of objects of class H2OParsedData, each corresponding to one of the splits.

Examples

Run this code
library(h2o)
localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)
irisPath = system.file("extdata", "iris.csv", package = "h2o")
iris.hex = h2o.importFile(localH2O, path = irisPath)
iris.folds = h2o.nFoldExtractor(iris.hex, nfolds=10, fold_to_extract = 4)
head(iris.folds[[1]])
summary(iris.folds[[1]])
head(iris.folds[[2]])
summary(iris.folds[[2]])

Run the code above in your browser using DataLab