R/automl.R
h2o.get_best_model.RdGet best model of a given family/algorithm for a given criterion from an AutoML object.
H2OAutoML object
One of "any", "basemodel", "deeplearning", "drf", "gbm", "glm", "stackedensemble", "xgboost"
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.
An H2OModel or NULL if no model of a given family is present
if (FALSE) { # \dontrun{
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")
} # }