powered by
Plot distribution of predictor variables on classes sorted by order of importance in model.
plotImpVarDist(rf, df, class.col, max.vars = 16, plot = TRUE)
an object inheriting from randomForest.
randomForest
data.frame with predictors in rf model.
rf
response column name in df.
df
number of variables to plot (from most important to least).
display the plot?
the ggplot2 object is invisibly returned.
ggplot2
# NOT RUN { data(mtcars) df <- mtcars df$am <- factor(df$am) rf <- randomForest(am ~ ., df, importance = TRUE) plotImpVarDist(rf, df, "am") # }
Run the code above in your browser using DataLab