Usage
# f <- rpart(formula=y ~ x1 + x2 + ...) # or rpart
## S3 method for class 'rpart':
validate(fit, method, B, bw, rule, type, sls, aics,
force, estimates, pr=TRUE,
k, rand, xval=10, FUN, \dots)
## S3 method for class 'validate.rpart':
print(x, \dots)
## S3 method for class 'validate.rpart':
plot(x, what=c("mse","dxy"), legendloc=locator, ...)
Arguments
fit
an object created by rpart
. You must have specified the
model=TRUE
argument to rpart
.
method,B,bw,rule,type,sls,aics,force,estimates
are there only for consistency with the generic validate
function; these are ignored
x
the result of validate.rpart
k
a sequence of cost/complexity values. By default these are obtained
from calling FUN
with no optional arguments or
from the rpart
cptable
object in the original fit object.
You may also specify a scalar or vec
rand
a random sample (usually omitted)
FUN
the name of a function which produces a sequence of trees, such
prune
.
...
additional arguments to FUN
(ignored by print,plot
).
pr
set to FALSE
to prevent intermediate results for each k
to be printed
what
a vector of things to plot. By default, 2 plots will be done, one for
mse
and one for Dxy
.
legendloc
a function that is evaluated with a single argument equal to 1
to
generate a list with components x, y
specifying coordinates of the
upper left corner of a legend, or a 2-vector. For the latter,
legendloc
spec