h2o.runif: Produce a Vector of Random Uniform Numbers

Description Usage Arguments Value Examples

View source: R/frame.R

Description

Creates a vector of random uniform numbers equal in length to the length of the specified H2O dataset.

Usage

1
h2o.runif(x, seed = -1)

Arguments

x

An H2OFrame object.

seed

A random seed used to generate draws from the uniform distribution.

Value

A vector of random, uniformly distributed numbers. The elements are between 0 and 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(h2o)
h2o.init()
prostate_path <- system.file("extdata", "prostate.csv", package = "h2o")
prostate <- h2o.importFile(path = prostate_path)
s <- h2o.runif(prostate)
summary(s)

prostate_train <- prostate[s <= 0.8,]
prostate_test <- prostate[s > 0.8,]
nrow(prostate_train) + nrow(prostate_test)

## End(Not run)

h2o documentation built on Oct. 10, 2021, 1:08 a.m.