Learn R Programming

kaps (version 0.9-8)

prune: Conduct cost-complexity pruining to obtain ideal tree size

Description

This function conducts a cost-complexity pruning in order to obtain ideal size of the tree.

Usage

## S3 method for class 'Tree':
prune(treeres, K = 10, 
	cost = function(y, yhat, status) sum(abs(y - yhat) * status))

Arguments

treeres
object of S4 class Tree.
K
The number of partitions
cost
cost function

See Also

lrtree