Learn R Programming

treemisc (version 0.0.1)

prune_se: Prune an rpart object

Description

Prune an rpart object using the standard error (SE) of the cross-validation results.

Usage

prune_se(object, prune = TRUE, se = 1)

Value

Either an object that inherits from class "rpart" (ideally, one that's been simplified using cost-complexity pruning with the 1-SE rule) or a numeric value representing the cost-complexity parameter to use for pruning.

Arguments

object

An object that inherits from class "rpart".

prune

Logical indicating whether or not to return the pruned decision tree. Default is TRUE. If FALSE, the optimal value of the cost-complexity parameter is returned instead.

se

Numeric specifying the number of standard errors to use when pruning the tree. Default is 1, which corresponds to the 1-SE rule described in Breiman et al. (1984).

References

Breiman, L., Friedman, J., and Charles J. Stone, R. A. O. (1984). Classification and Regression Trees. The Wadsworth and Brooks-Cole statistics-probability series. Taylor & Francis.

See Also