importance {rfPermute} | R Documentation |
Extract rfPermute Importance Scores and p-values.
Description
The importance
function extracts a matrix of
the observed importance scores and p-values from the object
produced by a call to rfPermute
. plotImportance
produces
a visualization of importance scores as either a barchart or heatmap.
Usage
## S3 method for class 'rfPermute'
importance(x, scale = TRUE, sort.by = NULL, decreasing = TRUE, ...)
plotImportance(
x,
plot.type = c("bar", "heatmap"),
imp.type = NULL,
scale = TRUE,
sig.only = FALSE,
alpha = 0.05,
n = NULL,
ranks = TRUE,
xlab = NULL,
ylab = NULL,
main = NULL,
size = 3,
plot = TRUE
)
Arguments
x |
for |
scale |
for permutation based measures, should the measures be divided their "standard errors"? |
sort.by |
character vector giving the importance metric(s) or p-values
to sort by. If |
decreasing |
logical. Should the sort order be increasing or decreasing? |
... |
arguments to be passed to and from other methods. |
plot.type |
plot importances as a |
imp.type |
character vector listing which importance measures to plot. Can be class names (for classification models) or names of overall importance measures (e.g., "MeanDecreaseAccuracy"). |
sig.only |
Plot only the significant (<= |
alpha |
a number specifying the critical alpha for identifying
predictors with importance scores significantly different from random.
This parameter is only relevant if |
n |
plot |
ranks |
plot ranks instead of actual importance scores? |
xlab , ylab |
labels for the x and y axes. |
main |
main title for plot. |
size |
a value specifying the size of the significance diamond in the
heatmap if the p-value <= |
plot |
display the plot? |
Author(s)
Eric Archer eric.archer@noaa.gov
Examples
data(mtcars)
# A classification model classifying cars to manual or automatic transmission
am.rp <- rfPermute(factor(am) ~ ., mtcars, ntree = 100, nrep = 50)
imp.scaled <- importance(am.rp, scale = TRUE)
imp.scaled
# plot scaled importance scores
plotImportance(am.rp, scale = TRUE)
# plot unscaled and only significant scores
plotImportance(am.rp, scale = FALSE, sig.only = TRUE)