plot.trim.sequence: Plot a Trim Sequence

Description Usage Arguments Details Side Effects Examples

Description

Allows the user to plot a trim sequence.

Usage

1
2
3
## S3 method for class 'trim.sequence'
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.

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.

Side Effects

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#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))

oblique.tree documentation built on April 15, 2017, 4:38 a.m.