Cost-complexity Pruning of a DStree Object

Share:

Description

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

Usage

1
snip(tree, cp)

Arguments

tree

a fitted object of class "DStree"

cp

complexity parameter to which the DStree object will be trimmed

Value

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

Examples

1
2
3
4
5
6
7
data(cost)
d.cost <- dis.cost(cost)

fit <- DStree(time~prevStroke+age+sex+alcohol+smoke,status="status",data=d.cost)

sfit<-snip(fit,cp=0.02)
plot(sfit) #plot smaller DStree object