Description Usage Arguments Value Examples
View source: R/plot_functions.R
Plot individual suggestion (direction to modify)
1 2 | plotSuggest(x, k = 1, .ordered = FALSE, .nonzero.only = FALSE,
.invisible = FALSE)
|
x |
an object returned by tweak(). |
k |
an integer. The tweaked direction of k-th instance will be plotted. |
.ordered |
a logical. If |
.nonzero.only |
a logical. If |
.invisible |
a logical. If |
a ggplot object (for replot).
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.