Extracts the terminal leaf nodes of a decision tree with one or two numeric predictor variables. These leaf nodes are then converted into a data frame, where each row represents a partition (or leaf or terminal node) that can easily be plotted in coordinate space.
A tree object. Supported classes include
rpart::rpart.object, or the compatible classes from
Logical. The function relies on
Logical. The function will automatically set the y-axis
variable as the first split variable in the tree provided unless
the user specifies
This function can be used with a regression or classification tree containing one or (at most) two numeric predictors.
A data frame comprising seven columns: the leaf node, its path, a set
of coordinates understandable to
ggplot2 (i.e., xmin, xmax, ymin, ymax),
and a final column corresponding to the predicted value for that leaf.
1 2 3 4 5 6 7 8 9 10 11 12 13
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.