Description Usage Arguments Details Value References See Also Examples
importance
calculates importances for rules, linear terms and input
variables in the prediction rule ensemble (pre), and creates a bar plot
of variable importances.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  importance(
object,
standardize = FALSE,
global = TRUE,
quantprobs = c(0.75, 1),
penalty.par.val = "lambda.1se",
round = NA,
plot = TRUE,
ylab = "Importance",
main = "Variable importances",
abbreviate = 10L,
diag.xlab = TRUE,
diag.xlab.hor = 0,
diag.xlab.vert = 2,
cex.axis = 1,
legend = "topright",
...
)

object 
an object of class 
standardize 
logical. Should baselearner importances be standardized
with respect to the outcome variable? If 
global 
logical. Should global importances be calculated? If

quantprobs 
optional numeric vector of length two. Only used when

penalty.par.val 
character or numeric. Value of the penalty parameter
λ to be employed for selecting the final ensemble. The default

round 
integer. Number of decimal places to round numeric results to.
If 
plot 
logical. Should variable importances be plotted? 
ylab 
character string. Plotting label for yaxis. Only used when

main 
character string. Main title of the plot. Only used when

abbreviate 
integer or logical. Number of characters to abbreviate
x axis names to. If 
diag.xlab 
logical. Should variable names be printed diagonally (that
is, in a 45 degree angle)? Alternatively, variable names may be printed
vertically by specifying 
diag.xlab.hor 
numeric. Horizontal adjustment for lining up variable names with bars in the plot if variable names are printed diagonally. 
diag.xlab.vert 
positive integer. Vertical adjustment for position of variable names, if printed diagonally. Corresponds to the number of character spaces added after variable names. 
cex.axis 
numeric. The magnification to be used for axis annotation
relative to the current setting of 
legend 
logical or character. Should legend be plotted for multinomial
or multivariate responses and if so, where? Defaults to 
... 
further arguments to be passed to 
See also sections 6 and 7 of Friedman & Popecus (2008).
A list with two dataframes: $baseimps
, giving the importances
for baselearners in the ensemble, and $varimps
, giving the importances
for all predictor variables.
Fokkema, M. (2020). Fitting prediction rule ensembles with R package pre. Journal of Statistical Software, 92(12), 130. https://doi.org/10.18637/jss.v092.i12
Friedman, J. H., & Popescu, B. E. (2008). Predictive learning via rule ensembles. The Annals of Applied Statistics, 2(3), 916954.
1 2 3 4 5 6 7 8  set.seed(42)
airq.ens < pre(Ozone ~ ., data = airquality[complete.cases(airquality),])
# calculate global importances:
importance(airq.ens)
# calculate local importances (default: over 25% highest predicted values):
importance(airq.ens, global = FALSE)
# calculate local importances (custom: over 25% lowest predicted values):
importance(airq.ens, global = FALSE, quantprobs = c(0, .25))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.