h2o (version 3.10.3.6)

h2o.insertMissingValues: Inserting Missing Values to an H2O DataH2OFrame

Description

*This is primarily used for testing*. Randomly replaces a user-specified fraction of entries in an H2O dataset with missing values.

Usage

h2o.insertMissingValues(data, fraction = 0.1, seed = -1)

Arguments

data
An H2OFrame object representing the dataset.
fraction
A number between 0 and 1 indicating the fraction of entries to replace with missing.
seed
A random number used to select which entries to replace with missing values. Default of seed = -1 will automatically generate a seed in H2O.

WARNING

This will modify the original dataset. Unless this is intended, this function should only be called on a subset of the original.

Examples

Run this code
library(h2o)
h2o.init()
irisPath <- system.file("extdata", "iris.csv", package = "h2o")
iris.hex <- h2o.importFile(path = irisPath)
summary(iris.hex)
irismiss.hex <- h2o.insertMissingValues(iris.hex, fraction = 0.25)
head(irismiss.hex)
summary(irismiss.hex)

Run the code above in your browser using DataCamp Workspace