Description Usage Arguments Side Effects Note Examples
Produces 2 plots. The first plots the r-square (apparent and
apparent - from cross-validation) versus the number of splits.
The second plots the Relative Error(cross-validation) +/- 1-SE from
cross-validation versus the number of splits. Same as rsq.rpart
but does some checking to make sure warnings/error is printed
when the user attempts to call the function in cases where either
cptable=NULL
or does not have the correct meaning to make the plots
useful. Identical to the rpart
function.
1 | rsq.itree(x)
|
x |
fitted model object of class |
Two plots are produced.
The labels are only appropriate for the "anova"
method. Further
the cptable from which the r-squared values are taken are not appropriate
if a penalty has been used. If this is the case, the method stops.
1 2 3 | #rpart's example:
z.auto <- itree(Mileage ~ Weight, car.test.frame)
rsq.itree(z.auto)
|
itree is based on the code of rpart.
Bug reports should be directed to this package's maintainer, not rparts'.
Regression tree:
itree(formula = Mileage ~ Weight, data = car.test.frame)
Variables actually used in tree construction:
[1] Weight
Root node error: 1354.6/60 = 22.576
n= 60
CP nsplit rel error xerror xstd
1 0.595349 0 1.00000 1.02697 0.178133
2 0.134528 1 0.40465 0.52391 0.084021
3 0.012828 2 0.27012 0.40198 0.075862
4 0.010000 3 0.25729 0.41299 0.075400
Warning message:
In printcp(x) :
cp is impacted by using penalties and is NOT comparable to unpenalized cp's.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.