Plot Important Variable Distribution
Plot distribution of predictor variables on classes sorted by order of importance in model.
plotImpVarDist(rf, df, class.col, max.vars = 16, plot = TRUE)
rf |
an object inheriting from |
df |
data.frame with predictors in |
class.col |
response column name in |
max.vars |
number of variables to plot (from most important to least). |
plot |
display the plot? |
the ggplot2
object is invisibly returned.
If the model in rf
was run with importance = TRUE
, then
'MeanDecreaseAccuracy' is used as the importance measure. Otherwise,
'MeanDecreaseGini' is used.
Eric Archer eric.archer@noaa.gov
data(mtcars) df <- mtcars df$am <- factor(df$am) rf <- randomForest(am ~ ., df, importance = TRUE) plotImpVarDist(rf, df, "am")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.