plotImpPreds | R Documentation |
For classification models, plot distribution of predictor variables on classes sorted by order of importance in model.
plotImpPreds(
x,
df,
class.col,
imp.type = NULL,
max.vars = 16,
scale = TRUE,
size = 1,
point.alpha = 0.2,
violin.alpha = 0.5,
plot = TRUE
)
x |
a |
df |
data.frame with predictors in |
class.col |
response column name in |
imp.type |
character string representing importance type to use for sorting predictors. |
max.vars |
number of variables to plot (from most important to least). |
scale |
For permutation based importance measures, should they be divided their "standard errors"? |
size, point.alpha, violin.alpha |
controls size of points and alpha values (transparency) for points and violin plots. |
plot |
display the plot? |
the ggplot2
object is invisibly returned.
If the model in x
is from randomForest
and was run
with importance = TRUE
, then 'MeanDecreaseAccuracy' is used as
the default importance measure for sorting. Otherwise, 'MeanDecreaseGini'
is used.
Eric Archer eric.archer@noaa.gov
library(randomForest)
data(mtcars)
df <- mtcars
df$am <- factor(df$am)
rf <- randomForest(am ~ ., df, importance = TRUE)
plotImpPreds(rf, df, "am")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.