Learn R Programming

h2o (version 2.8.4.4)

h2o.insertMissingValues: Replace Entries in H2O Data Set with Missing Value

Description

Replaces a user-specified fraction of entries in a H2O dataset with missing values.

Usage

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

Arguments

data
An H2OParsedData object representing the dataset.
fraction
A number between 0 and 1 indicating the fraction of entries to replace with missing values.
seed
A random number used to select which entries to replace with missing values. If seed = -1, one will automatically be generated by H2O.

Value

  • Returns an H2OParsedData object that represents the dataset with missing values inserted.

Details

This method modifies the input dataset in place.

Examples

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

Run the code above in your browser using DataLab