These are objects representing fitted regression or classification
trees.
The classes are:
treetree.sequence
GENERATION:
Objects of class "tree" are created by the tree function.
Objects of class "tree.sequence" are the result of operations
to a tree to make it smaller; they may be made by either prune.tree
or shrink.tree.
METHODS:
Generic functions that have methods for class "tree" are:
[, browser, deviance, identify, labels, plot, predict,
print, residuals, summary, text.
Generic functions with methods for "tree.sequence" are:
plot.
INHERITANCE:
The shrink.tree function produces either an object with class
c("bonzai", "tree") or with class c("shrink", "tree.sequence").
STRUCTURE:
The following components must be included in a legitimate tree object.
Of these, only the where component has the same length as
the data used to fit the tree object.
frame:
data frame with one row for each node in the tree.
The row.names of frame contain the (unique) node numbers that
follow a binary ordering indexed by node depth.
Elements of frame include var,
the variable used in the split at each node
(leaf nodes are denoted by the string <leaf>), n, the size of each node,
dev, the deviance of each node,
yval, the fitted value of the response at each node,
splits, a two column matrix of left and right split labels
for each node.
Classification trees have an additional element yprob,
the matrix containing the class probabilities for each node.
where:
vector, the same length as the number of observations in the root node,
containing the row number of frame corresponding to the leaf node
that each observation falls into.
terms:
an object of mode expression and class term summarizing the formula.
Used by various methods, but typically not of direct relevance to users.
call:
an image of the call that produced the object, but with the arguments
all named and with the actual formula included as the formula argument.
To reevaluate the call, say update(tree).
Optional components include the matrix of predictors (x) and the
response variable (y) used to construct the tree object.
The structure of an object of class "tree.sequence" is:
size:
the number of (effective) terminal nodes in each tree of the sequence.
deviance:
total deviance of each tree in the sequence.
k:
the value of a parameter used to produce each tree in the sequence.