Description Usage Arguments Details Author(s) References See Also Examples
A simple function to take the output of a partition model created with rpart
and return information abouthe complexity parameter and performance of varies models.
1 | getcp(TREE)
|
TREE |
An object of class |
This function prints out a table of the complexity parameter, number of splits, relative error, cross validation error, and standard deviation of cross validation error for a partition model. It adds helpful advice for what the value of CP is for the tree that had the lowest cross validation error and also the value of CP for the simplest tree with a cross validation error at most 1 standard deviation above the lowest.
Further, a plot is made of the estimated generalization error (xerror
) versus the number of splits to illustrate when the tree stops improving. Vertical lines are draw at the number of splits corresponding to the lowest estimated generalization error to the tree selected by the one standard deviation rule.
Adam Petrie
Introduction to Regression and Modeling
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.