View source: R/plot_e2tree_click.R
| plot_e2tree_click | R Documentation |
Displays an E2Tree as an interactive plot in the R graphics device. Click on nodes to see detailed information in the console. Right-click or press ESC to exit interactive mode.
plot_e2tree_click(
fit,
data,
ensemble,
main = "E2Tree - Click on nodes (ESC to exit)",
...
)
fit |
An e2tree object |
data |
The training data used to build the tree |
ensemble |
The ensemble model (randomForest or ranger) |
main |
Plot title (default: "E2Tree - Click on nodes (ESC to exit)") |
... |
Additional arguments passed to rpart.plot |
This function converts the e2tree object to an rpart object and displays it using rpart.plot. You can then click on any node to see:
Node ID and type (terminal/internal)
Number of observations
Prediction and probability/purity
Decision path to reach the node
Class distribution (for classification)
Split rule (for internal nodes)
Observations in the node (for terminal nodes)
Invisibly returns the rpart object
# After creating an e2tree object (requires interactive session)
if (interactive()) {
plot_e2tree_click(tree, training, ensemble)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.