plotSuggest: Plot individual suggestion (direction to modify)

Description Usage Arguments Value Examples

View source: R/plot_functions.R

Description

Plot individual suggestion (direction to modify)

Usage

1
2
plotSuggest(x, k = 1, .ordered = FALSE, .nonzero.only = FALSE,
  .invisible = FALSE)

Arguments

x

an object returned by tweak().

k

an integer. The tweaked direction of k-th instance will be plotted.

.ordered

a logical. If .ordered = TRUE, features are sorted by suggestion.

.nonzero.only

a logical. If .nonzero.only = TRUE, feature with suggestion = 0 is not be shown.

.invisible

a logical. If .invisible = TRUE, plot won't be shown.

Value

a ggplot object (for replot).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
X <- iris[, 1:(ncol(iris)-1)]
true.y <- iris[, ncol(iris)]

rf.iris <- randomForest(X, true.y, ntree=30)
es.rf <- set.eSatisfactory(forest.rf, ntree = 30, epsiron = 0.3, resample = TRUE)
tweaked <- tweak(es.rf, newdata= X.test, label.from = "spam", label.to = "nonspam",
                 .dopar = TRUE)

plotSuggest(tweaked, k = 1)
plotSuggest(tweaked, k = 1, .ordered = TRUE, .nonzero.only = TRUE)

## End(Not run)

katokohaku/featureTweakR documentation built on May 17, 2019, 11:17 p.m.