Description Usage Arguments Details Value Examples
View source: R/importance_plot.R
importance_plot make a graph of variable importance
1 | importance_plot(x, ...)
|
x |
is an rpart or gbm.step object |
... |
extra functions or arguments |
takes an 'rpart' or 'gbm.step' fitted object and makes a plot of variable importance
a ggplot plot of the variable importance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
# an rpart object
library(rpart)
library(treezy)
fit.rpart <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
importance_plot(fit.rpart)
# you can even use piping
fit.rpart %>% importance_plot
# a randomForest object
set.seed(131)
ozone.rf <- randomForest(Ozone ~ ., data=airquality, mtry=3,
importance=TRUE, na.action=na.omit)
print(ozone.rf)
## Show "importance" of variables: higher value mean more important:
importance(ozone.rf)
## use importance_table
importance_table(ozone.rf)
# now plot it
importance_plot(ozone.rf)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.