h2o.get_best_model: Get best model of a given family/algorithm for a given...

Description Usage Arguments Value Examples

View source: R/automl.R

Description

Get best model of a given family/algorithm for a given criterion from an AutoML object.

Usage

1
2
3
4
5
6
7
h2o.get_best_model(
  object,
  algorithm = c("any", "basemodel", "deeplearning", "drf", "gbm", "glm",
    "stackedensemble", "xgboost"),
  criterion = c("AUTO", "AUC", "AUCPR", "logloss", "MAE", "mean_per_class_error",
    "deviance", "MSE", "predict_time_per_row_ms", "RMSE", "RMSLE", "training_time_ms")
)

Arguments

object

H2OAutoML object

algorithm

One of "any", "basemodel", "deeplearning", "drf", "gbm", "glm", "stackedensemble", "xgboost"

criterion

Criterion can be one of the metrics reported in the leaderboard. If set to NULL, the same ordering as in the leaderboard will be used. Avaliable criteria:

  • Regression metrics: deviance, RMSE, MSE, MAE, RMSLE

  • Binomial metrics: AUC, logloss, AUCPR, mean_per_class_error, RMSE, MSE

  • Multinomial metrics: mean_per_class_error, logloss, RMSE, MSE

The following additional leaderboard information can be also used as a criterion:

  • 'training_time_ms': column providing the training time of each model in milliseconds (doesn't include the training of cross validation models).

  • 'predict_time_per_row_ms': column providing the average prediction time by the model for a single row.

Value

An H2OModel or NULL if no model of a given family is present

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(h2o)
h2o.init()
prostate_path <- system.file("extdata", "prostate.csv", package = "h2o")
prostate <- h2o.importFile(path = prostate_path, header = TRUE)
y <- "CAPSULE"
prostate[,y] <- as.factor(prostate[,y])  #convert to factor for classification
aml <- h2o.automl(y = y, training_frame = prostate, max_runtime_secs = 30)
gbm <- h2o.get_best_model(aml, "gbm")

## End(Not run)

h2o documentation built on Oct. 10, 2021, 1:08 a.m.