prune.itree {itree} | R Documentation |
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
.
prune(tree, ...) ## S3 method for class 'itree' prune(tree, cp, ...)
tree |
fitted model object of class |
cp |
Complexity parameter to which the |
... |
further arguments passed to or from other methods. |
A new itree
object that is trimmed to the value cp
.
#the rpart example: z.auto <- itree(Mileage ~ Weight, car.test.frame) zp <- prune(z.auto, cp=0.1) plot(zp) #plot smaller itree object