powered by
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 )
the ggplot2 object is invisibly returned.
ggplot2
a rfPermute or randomForest model object.
rfPermute
randomForest
data.frame with predictors in rf model.
rf
response column name in df.
df
character string representing importance type to use for sorting predictors.
number of variables to plot (from most important to least).
For permutation based importance measures, should they be divided their "standard errors"?
controls size of points and alpha values (transparency) for points and violin plots.
display the plot?
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")
Run the code above in your browser using DataLab