Learn R Programming

h2o (version 2.8.4.4)

h2o.confusionMatrix: Build a Confusion Matrix from H2O Classification Predictions

Description

Constructs a confusion matrix from a column of predicted responses and a column of actual (reference) responses in H2O. Note that confusion matrices describe prediciton errors for classification data only.

Usage

h2o.confusionMatrix(data, reference)

Arguments

data
An H2OParsedData object that represents the predicted response values. (Must be a single column).
reference
An H2OParsedData object that represents the actual response values. Must have the same dimensions as data.

Value

  • Returns a confusion matrix with the actual value counts along the rows and the predicted value counts along the columns.

See Also

H2OParsedData

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.gbm = h2o.gbm(x = 3:9, y = 2, data = prostate.hex)
prostate.pred = h2o.predict(prostate.gbm)
h2o.confusionMatrix(prostate.pred[,1], prostate.hex[,2])

Run the code above in your browser using DataLab