Description Usage Arguments Value See Also Examples
Determines a nested sequence of subtrees of the supplied rpart
object
by recursively snipping
off the least important splits, based on the
complexity parameter (cp
).
1 2 3 4 |
tree |
fitted model object of class |
cp |
Complexity parameter to which the |
... |
further arguments passed to or from other methods. |
A new rpart
object that is trimmed to the value cp
.
1 2 3 | z.auto <- rpart(Mileage ~ Weight, car.test.frame)
zp <- prune(z.auto, cp = 0.1)
plot(zp) #plot smaller rpart object
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.