h2o.kfold_column: Produce a k-fold column vector.

View source: R/frame.R

h2o.kfold_columnR Documentation

Produce a k-fold column vector.

Description

Create a k-fold vector useful for H2O algorithms that take a fold_assignments argument.

Usage

h2o.kfold_column(data, nfolds, seed = -1)

Arguments

data

A dataframe against which to create the fold column.

nfolds

The number of desired folds.

seed

A random seed, -1 indicates that H2O will choose one.

Value

Returns an H2OFrame object with fold assignments.

Examples

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

f <- "https://s3.amazonaws.com/h2o-public-test-data/smalldata/iris/iris_wheader.csv"
iris <- h2o.importFile(f)
kfolds <- h2o.kfold_column(iris, nfolds = 5, seed = 1234)

## End(Not run)

h2o documentation built on Aug. 9, 2023, 9:06 a.m.