prune.itree: Cost-complexity Pruning of an itree Object

Description Usage Arguments Value See Also Examples

View source: R/prune.itree.R

Description

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

Usage

1
2
3
4
prune(tree, ...)

## S3 method for class 'itree'
prune(tree, cp, ...)

Arguments

tree

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

cp

Complexity parameter to which the itree object will be trimmed.

...

further arguments passed to or from other methods.

Value

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

See Also

itree

Examples

1
2
3
4
#the rpart example:
z.auto <- itree(Mileage ~ Weight, car.test.frame)
zp <- prune(z.auto, cp=0.1)
plot(zp) #plot smaller itree object

Example output

itree is based on the code of rpart.
Bug reports should be directed to this package's maintainer, not rparts'.

itree documentation built on May 2, 2019, 7:25 a.m.

Related to prune.itree in itree...