Optim.CART: Tune CART for the optimal complexity parameter

Description Usage Arguments Details Value References Examples

Description

The complexity parameter aims to save computing time by pruning off splits that are obviously not worthwhile. This function starting with null value of cp and ranks the different possibles levels of pruning trees find best CART for different levels of cost complexity. The main role of this parameter is to save computing time by pruning off splits that are obviously not worthwhile.

Usage

1
Optim.CART(formula, data, p, includedata = FALSE, seed = NULL, ...)

Arguments

formula

A formula of the form y ~ x1 + x2 + ...

data

Data frame from which variables specified in formula are preferentially to be taken.

p

A percentage of training elements

includedata

logicals. If TRUE the training and testing datasets are returned.

seed

a single value, interpreted as an integer, or NULL. The default value is NULL, but for future checks of the model or models generated it is advisable to set a random seed to be able to reproduce it.

...

arguments passed to rpart

Details

Classification And Regression Tree (CART) are a decision tree learning technique that produces either classification or regression trees, first introduced by Breiman et al.(1984). Trees used for regression and trees used for classification have some similarities - but also some differences, such as the procedure used to determine where to split.

Value

An object of class Optim. See Optim.object

References

Breiman L., Friedman J. H., Olshen R. A., and Stone, C. J. (1984) Classification and Regression Trees. Wadsworth.

Examples

1
2
3
4
5
6
7
if(interactive()){
## Load a Dataset
data(AustralianCredit)
## Generate a model
modelFit <- Optim.CART(Y~., AustralianCredit, p = 0.7, seed=2018)
modelFit
}

economistgame/OptimClassifier documentation built on Jan. 25, 2022, 12:22 p.m.