Skip to content

Instantly share code, notes, and snippets.

@GarrettMooney
Created February 28, 2018 04:07
Show Gist options
  • Save GarrettMooney/7e321868784800fd231dd4d1e7f1f1c9 to your computer and use it in GitHub Desktop.
Save GarrettMooney/7e321868784800fd231dd4d1e7f1f1c9 to your computer and use it in GitHub Desktop.
function to get AUC from H2O models
#' description:
#' Get the AUC for the {validation,test} data set for a given model.
#' usage:
#' list(best_dl, best_gbm) %>% map_dbl(h2o_auc_v) %>% set_names('DL AUC', 'GBM AUC')
#' list(best_dl, best_gbm) %>% map_dbl(h2o_auc_t) %>% set_names('DL AUC', 'GBM AUC')
library(h2o)
library(purrr)
h2o_auc_t <- compose(h2o.auc, partial(h2o.performance, newdata = test))
h2o_auc_v <- compose(h2o.auc, partial(h2o.performance, newdata = valid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment