importance_plot: importance_plot

Description Usage Arguments Details Value Examples

Description

importance_plot make a graph of variable importance

Usage

1

Arguments

x

is an rpart or gbm.step object

Details

takes an 'rpart' or 'gbm.step' fitted object and makes a plot of variable importance

Value

a ggplot plot of the variable importance

Examples

 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
 # an rpart object
 library(rpart)
 library(neato)
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)

njtierney/neato documentation built on May 23, 2019, 8:22 p.m.