h2o.thresholds_and_metric_scores: Retrieve the thresholds and metric scores table

View source: R/models.R

h2o.thresholds_and_metric_scoresR Documentation

Retrieve the thresholds and metric scores table

Description

Retrieves the thresholds and metric scores table from a H2OBinomialUpliftMetrics or a H2OBinomialMetrics.

Usage

h2o.thresholds_and_metric_scores(
  object,
  train = FALSE,
  valid = FALSE,
  xval = FALSE
)

Arguments

object

A H2OBinomialUpliftMetrics or a H2OBinomialMetrics

train

Retrieve the training thresholds and metric scores table

valid

Retrieve the validation thresholds and metric scores table

xval

Retrieve the cross-validation thresholds and metric scores table (only for H2OBinomialMetrics)

Details

The table contains indices, thresholds, all cumulative uplift values and cumulative number of observations for uplift binomial models or thresholds and maximal metric values for binomial models. If "train" and "valid" parameters are FALSE (default), then the training table is returned. If more than one parameter is set to TRUE, then a named vector of tables is returned, where the names are "train", "valid".

Examples

## Not run: 
library(h2o)
h2o.init()
f <- "https://s3.amazonaws.com/h2o-public-test-data/smalldata/uplift/criteo_uplift_13k.csv"
train <- h2o.importFile(f)
train$treatment <- as.factor(train$treatment)
train$conversion <- as.factor(train$conversion)

model <- h2o.upliftRandomForest(training_frame=train, x=sprintf("f%s",seq(0:10)), y="conversion",
                                ntrees=10, max_depth=5, treatment_column="treatment", 
                                auuc_type="AUTO")
perf <- h2o.performance(model, train=TRUE) 
h2o.thresholds_and_metric_scores(perf)

## End(Not run)

h2o documentation built on May 29, 2024, 4:26 a.m.