R/models.R
Plot Variable Importances
h2o.varimp_plot(model, num_of_features = NULL)
model | A trained model (accepts a trained random forest, GBM,
or deep learning model, will use |
---|---|
num_of_features | The number of features shown in the plot (default is 10 or all if less than 10). |
h2o.std_coef_plot
for GLM.
# NOT RUN { library(h2o) h2o.init() prosPath <- system.file("extdata", "prostate.csv", package="h2o") hex <- h2o.importFile(prosPath) hex[,2] <- as.factor(hex[,2]) model <- h2o.gbm(x = 3:9, y = 2, training_frame = hex, distribution = "bernoulli") h2o.varimp_plot(model) # for deep learning set the variable_importance parameter to TRUE iris.hex <- as.h2o(iris) iris.dl <- h2o.deeplearning(x = 1:4, y = 5, training_frame = iris.hex, variable_importances = TRUE) h2o.varimp_plot(iris.dl) # }