oblique.tree (version 1.1.1)

plot.trim.sequence: Plot a Trim Sequence

Description

Allows the user to plot a trim sequence.

Usage

"plot"(x, ..., type = "l", ylim = range(x$dev), order = c("decreasing", "increasing"))

Arguments

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.

Side Effects

Plots deviance or number of misclassifications (or total loss) versus size for a sequence of trimmed trees.

Details

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.

Examples

Run this code
#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))

Run the code above in your browser using DataLab