jvatree: Cross Validated Tree Model

Description Usage Arguments Details Value Examples

View source: R/jvatree.R

Description

Fit a classification or regression tree model to data, and automatically prune the tree based on the cross-validation error.

Usage

1

Arguments

...

Arguments provided to rpart including formula (the only required argument).

Details

First a tree model is fit. Then the model is pruned such that it has the fewest number of splits that yield a mean cross-validation error less than the minimum cross-validation error plus one standard error.

Value

An object of class rpart. See rpart.object.

Examples

1
2
3
4
fit <- jvatree(Ozone ~ ., data=airquality)
par(xpd=NA) # otherwise on some devices the text is clipped
plot(fit)
text(fit, use.n=TRUE)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.