snip: Cost-complexity Pruning of a DStree Object

Description Usage Arguments Value Examples

View source: R/DStree.snip.R

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


DStree documentation built on May 20, 2017, 4:56 a.m.
Search within the DStree package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.