Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for h2o package #8
Comments
|
Here is what #'
#' Retrieve the variable importance.
#'
#' @param object An \linkS4class{H2OModel} object.
#' @export
h2o.varimp <- function(object) {
o <- object
if( is(o, "H2OModel") ) {
vi <- o@model$variable_importances
if( is.null(vi) ) { vi <- object@model$standardized_coefficient_magnitudes } # no true variable importances, maybe glm coeffs? (return standardized table...)
if( is.null(vi) ) {
warning("This model doesn't have variable importances", call. = FALSE)
return(invisible(NULL))
}
vi
} else {
warning( paste0("No variable importances for ", class(o)) )
return(NULL)
}
} |
Some support for regression models is there, but it needs to be tested! Also,
h2o.varimp()output is model specific!