Learn R Programming

h2o (version 2.8.4.4)

h2o.rebalance: Rebalance a H2O data frame

Description

Rebalance (repartition) an existing H2O data set into given number of chunks (per Vec), for load-balancing across multiple threads or nodes. Does not alter data.

Usage

h2o.rebalance(data, chunks, key)

Arguments

data
An H2OParsedData object representing the dataset to rebalance.
chunks
A numeric value indicating how many chunks to rebalance the dataset into. Suggested: Around 4 chunks per CPU core.
key
Destination key for rebalanced H2OParsedData object.

Value

  • Returns the rebalanced object of class H2OParsedData.

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.reb = h2o.rebalance(iris.hex, chunks = 32)
summary(iris.reb)
iris.reb2 = h2o.rebalance(iris.hex, chunks = 32, key = "iris.rebalanced")
summary(iris.reb2)

Run the code above in your browser using DataLab