R/models.R
Given predicted values (target for regression, class-1 probabilities or binomial or per-class probabilities for multinomial), compute a model metrics object
h2o.make_metrics(predicted, actuals, domain = NULL, distribution = NULL)
predicted | An H2OFrame containing predictions |
---|---|
actuals | An H2OFrame containing actual values |
domain | Vector with response factors for classification. |
distribution | Distribution for regression. |
Returns an object of the H2OModelMetrics subclass.
# NOT RUN { library(h2o) h2o.init() prosPath <- system.file("extdata", "prostate.csv", package="h2o") prostate.hex <- h2o.uploadFile(path = prosPath) prostate.hex$CAPSULE <- as.factor(prostate.hex$CAPSULE) prostate.gbm <- h2o.gbm(3:9, "CAPSULE", prostate.hex) pred <- h2o.predict(prostate.gbm, prostate.hex)[,3] ## class-1 probability h2o.make_metrics(pred,prostate.hex$CAPSULE) # }