plot.trim.sequence {oblique.tree} | R Documentation |
Allows the user to plot a trim sequence.
## S3 method for class 'trim.sequence': plot(x, ..., type = "l", ylim = range(x$dev), order = c("decreasing", "increasing"))
x |
object of class trim.sequence . This is assumed to be the result of some function that produces an object with the same named components (comp , deviance , h ) as that returned by trim.oblique.tree . |
order |
of comp on the plot. Use "decreasing" for a natural ordering of the complexity of tree and the amount of trimming. Only the first character is needed. |
type, ylim, ... |
graphical parameters. |
This function is a method for the generic function plot()
for class trim.sequence
. It can be invoked by calling plot(x)
for an object x
of the appropriate class, or directly by calling plot.trim.sequence(x)
regardless of the class of the object.
Plots deviance or number of misclassifications (or total loss) versus size for a sequence of trimmed trees.
#grow an oblique tree data(Pima.tr, package="MASS") ob.tree <- oblique.tree( type~., Pima.tr, oblique.splits="only", variable.selection="model.selection.aic") #look at the tree plot(ob.tree);text(ob.tree) #and its trim sequence plot(trim.oblique.tree(ob.tree))