boosting.cv {adabag}R Documentation

Runs v-fold cross validation with adaboost.M1

Description

The data are divided into v non-overlapping subsets of roughly equal size. Then, adaboost.M1 is applied on (v-1) of the subsets. Finally, predictions are made for the left out subsets, and the process is repeated for each of the v subsets.

Usage

boosting.cv(formula, data, v = 10, boos = TRUE, mfinal = 100, 
 coeflearn = "Breiman", minsplit = 5, cp = 0.01, maxdepth = nlevels(vardep))

Arguments

formula a formula, as in the lm function.
data a data frame in which to interpret the variables named in formula
boos if TRUE (by default), a bootstrap sample of the training set is drawn using the weights for each observation on that iteration. If FALSE, every observation is used with its weights.
v An integer, specifying the type of v-fold cross validation. Defaults to 10. If v is set as the number of observations, leave-one-out cross validation is carried out. Besides this, every value between two and the number of observations is valid and means that roughly every v-th observation is left out.
mfinal an integer, the number of iterations for which boosting is run or the number of trees to use. Defaults to mfinal=100 iterations.
coeflearn if "Breiman"(by default), alpha=1/2ln((1-err)/err) is used. If "Freund" alpha=ln((1-err)/err) is used. Where alpha is the weight updating coefficient.
minsplit the minimum number of observations that must exist in a node, in order for a split to be attempted.
cp complexity parameter. Any split that does not decrease the overall lack of fit by a factor of cp is not attempted.
maxdepth set the maximum depth of any node of the final tree, with the root node counted as depth 0 (past 30 rpart will give nonsense results on 32-bit machines). Defaults to the number of classes.

Value

An object of class boosting.cv, which is a list with the following components:

class the class predicted by the ensemble classifier.
confusion the confusion matrix which compares the real class with the predicted one.
error returns the average error.

Author(s)

Esteban Alfaro Cortes Esteban.Alfaro@uclm.es, Matias Gamez Martinez Matias.Gamez@uclm.es and Noelia Garcia Rubio Noelia.Garcia@uclm.es

References

Alfaro, E., Gamez, M. and Garcia, N. (2007): ``Multiclass corporate failure prediction by Adaboost.M1''. International Advances in Economic Research, Vol 13, 3, pp. 301–312.

Freund, Y. and Schapire, R.E. (1996): "Experiments with a New Boosting Algorithm". In Proceedings of the Thirteenth International Conference on Machine Learning, pp. 148–156, Morgan Kaufmann.

Breiman, L. (1998): "Arcing classifiers". The Annals of Statistics, Vol 26, 3, pp. 801–849.

See Also

adaboost.M1, predict.boosting

Examples

## rpart library should be loaded
library(rpart)
data(iris)
names(iris)<-c("LS","AS","LP","AP","Especies")
iris.boostcv <- boosting.cv(Especies ~ ., v=10, data=iris, mfinal=10, maxdepth=3)

data(kyphosis)
kyphosis.boostcv <- boosting.cv(Kyphosis ~ Age + Number + Start, data=kyphosis, 
        mfinal=15)

## rpart and mlbench libraries should be loaded
## Data Vehicle (four classes) 
library(rpart)
library(mlbench)
data(Vehicle)
Vehicle.boost.cv <- boosting.cv(Class ~.,data=Vehicle,mfinal=25, maxdepth=5)
Vehicle.boost.cv[-1]


[Package adabag version 1.1 Index]