R/permutation_varimp.R
h2o.permutation_importance_plot.RdThis method plots either a bar plot or if n_repeats > 1 a box plot and returns the variable importance table.
h2o.permutation_importance_plot(
object,
newdata,
metric = c("AUTO", "AUC", "MAE", "MSE", "RMSE", "logloss", "mean_per_class_error",
"PR_AUC"),
n_samples = 10000,
n_repeats = 1,
features = NULL,
seed = -1,
num_of_features = NULL
)A trained supervised H2O model.
Training frame of the model which is going to be permuted
Metric to be used. One of "AUTO", "AUC", "MAE", "MSE", "RMSE", "logloss", "mean_per_class_error", "PR_AUC". Defaults to "AUTO".
Number of samples to be evaluated. Use -1 to use the whole dataset. Defaults to 10 000.
Number of repeated evaluations. Defaults to 1.
Character vector of features to include in the permutation importance. Use NULL to include all.
Seed for the random generator. Use -1 to pick a random seed. Defaults to -1.
The number of features shown in the plot (default is 10 or all if less than 10).
H2OTable with variable importance.
if (FALSE) { # \dontrun{
library(h2o)
h2o.init()
prostate_path <- system.file("extdata", "prostate.csv", package = "h2o")
prostate <- h2o.importFile(prostate_path)
prostate[, 2] <- as.factor(prostate[, 2])
model <- h2o.gbm(x = 3:9, y = 2, training_frame = prostate, distribution = "bernoulli")
h2o.permutation_importance_plot(model, prostate)
} # }