| plot.pprf | R Documentation |
Visualizes a pprf model. By default, shows variable importance with
one plot per metric side by side. Use metric to show a single
importance metric.
## S3 method for class 'pprf'
plot(x, type = "importance", metric = NULL, tree_index = 1L, node = 1L, ...)
x |
A pprf model. |
type |
Character string specifying the plot type.
|
metric |
Character string selecting a single importance metric
to plot: |
tree_index |
Integer index of the tree to plot (1-based). Only used when
|
node |
Integer index of the node for projection plots. Defaults to 1 (root).
Only used when |
... |
Additional arguments passed to the internal plotting function. |
A ggplot2-compatible object (invisibly). The importance grid returns
a patchwork object that works with ggplot2::ggsave().
if (requireNamespace("ggplot2", quietly = TRUE) &&
requireNamespace("patchwork", quietly = TRUE)) {
forest <- pprf(Species ~ ., data = iris, size = 10)
plot(forest) # all metrics side by side
plot(forest, metric = "permuted") # single metric
plot(forest, type = "structure", tree_index = 1)
plot(forest, type = "projection", tree_index = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.