arbor
fit,
under cross validation, for a set of complexity parameter values.
xpred.arbor(fit, xval=10, cp)
arbor
object.
cptable
component of the fit.
Complexity penalties are actually ranges, not values.
If the
cp
values found in the table
were .36, .28, and .13, for instance,
this means that the first row of the table holds
for all complexity penalties in the range [.36,1],
the second row for cp in the range [.28, .36) and the third row for [.13,.28).
By default, the geometric mean of each interval is used for cross validation.
fit <- arbor(Mileage ~ Weight, car.test.frame) xmat <- xpred.arbor(fit) xerr <- (xmat - car.test.frame$Mileage)^2 apply(xerr, 2, sum) # cross-validated error estimate # Approx same result as rel. error from printcp(fit) apply(xerr, 2, sum)/var(car.test.frame$Mileage)