Cost-complexity Pruning of an Arbor Object

DESCRIPTION:

Determines a nested sequence of subtrees of the supplied arbor object by recursively snipping off the least important splits, based on the complexity parameter ( cp).

USAGE:

prune.arbor(tree, cp) 

REQUIRED ARGUMENTS:

tree
fitted model object of class arbor. This is assumed to be the result of some function that produces an object with the same named components as that returned by the arbor function.

OPTIONAL ARGUMENTS:

cp
Complexity parameter to which the arbor object will be trimmed. The default value is zero, which will return the full tree.

VALUE:

A new arbor object that is trimmed to the value cp.

SEE ALSO:

EXAMPLES:

z.auto <- arbor(Mileage ~ Weight, car.test.frame)
zp <- prune.arbor(z.auto, cp=.03) 
plot(zp) #plot smaller arbor object 
text(zp) #add labels to plot