Learn R Programming

h2o (version 2.8.4.4)

h2o.anomaly: Anomaly Detection via H2O Deep Learning Model

Description

Detect anomalies in a H2O dataset using a H2O deep learning model with auto-encoding.

Usage

h2o.anomaly(data, model, key = "", threshold = -1.0)

Arguments

data
An H2OParsedData object.
model
An H2ODeepLearningModel object that represents the model to be used for anomaly detection. Must have been built with the argument autoencoder = TRUE in h2o
key
(Optional) The unique hex key assigned to the resulting dataset. If none is given, a key will automatically be generated.
threshold
(Optional) Threshold of reconstruction error for rows to be displayed in logs. If set to -1.0, this defaults to 10 times the MSE.

Value

  • Returns an H2OParsedData object with a single column containing the reconstruction MSE.

See Also

H2OParsedData, H2ODeepLearningModel, h2o.deeplearning

Examples

Run this code
library(h2o)
localH2O = h2o.init()
prosPath = system.file("extdata", "prostate.csv", package = "h2o")
prostate.hex = h2o.importFile(localH2O, path = prosPath)
prostate.dl = h2o.deeplearning(x = 3:9, y = 2, data = prostate.hex, autoencoder = TRUE,
                               hidden = c(10, 10), epochs = 5)
prostate.anon = h2o.anomaly(prostate.hex, prostate.dl)
head(prostate.anon)

Run the code above in your browser using DataLab