Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.varImp.train

Plotting variable importance measures


Description

This function produces lattice and ggplot plots of objects with class "varImp.train". More info will be forthcoming.

Usage

## S3 method for class 'varImp.train'
plot(x, top = dim(x$importance)[1], ...)

## S3 method for class 'varImp.train'
ggplot(
  data,
  mapping = NULL,
  top = dim(data$importance)[1],
  ...,
  environment = NULL
)

Arguments

x, data

an object with class varImp.

top

a scalar numeric that specifies the number of variables to be displayed (in order of importance)

...

arguments to pass to the lattice plot function (dotplot and panel.needle)

mapping, environment

unused arguments to make consistent with ggplot2 generic method

Details

For models where there is only one importance value, such a regression models, a "Pareto-type" plot is produced where the variables are ranked by their importance and a needle-plot is used to show the top variables. Horizontal bar charts are used for ggplot.

When there is more than one importance value per predictor, the same plot is produced within conditioning panels for each class. The top predictors are sorted by their average importance.

Value

a lattice plot object

Author(s)

Max Kuhn


caret

Classification and Regression Training

v6.0-86
GPL (>= 2)
Authors
Max Kuhn [aut, cre], Jed Wing [ctb], Steve Weston [ctb], Andre Williams [ctb], Chris Keefer [ctb], Allan Engelhardt [ctb], Tony Cooper [ctb], Zachary Mayer [ctb], Brenton Kenkel [ctb], R Core Team [ctb], Michael Benesty [ctb], Reynald Lescarbeau [ctb], Andrew Ziem [ctb], Luca Scrucca [ctb], Yuan Tang [ctb], Can Candan [ctb], Tyler Hunt [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.