For overall tree structure (node = -1), A figure of class
visNetwork is drawn. Otherwise, a figure of class ggplot is drawn.
Arguments
x
a fitted model object of class Treee, which is assumed to be the
result of the Treee() function.
data
the original data you used to fit the Treee object if you want
the individual plot for each node. Otherwise, you can leave this parameter
blank if you only need the overall tree structure diagram.
node
the node index that you are interested in. By default, it is set
to -1 and the overall tree structure is drawn.
...
further arguments passed to or from other methods.
Overall tree structure
A full tree diagram (via the R package visNetwork) is shown if node is
not provided (default is -1). The color shows the most common (plurality)
class inside each node. The size of each terminal node is based on its
relative sample size. Under every node, you see the plurality class, the
fraction of the correctly predicted training sample vs. the node's sample
size, and the node index, respectively. When you click on the node, an
information panel with more details will appear.
Individual plot for each node
The node index and the original training data are required to return a more
detailed plot within a specific node. The density plot will be provided
when only two levels are left for the response variable in a node (like in
a binary classification problem). Samples are projected down to their first
linear discriminant scores (LD1). A scatter plot will be provided if a node
contains more than two classes. Samples are projected down to their first
and second linear discriminant scores.