Learn R Programming

adabag (version 2.1)

adabag-package: Applies Adaboost.M1 and Bagging

Description

This package implements Freund and Schapire's Adaboost.M1 algorithm and Breiman's Bagging algorithm using classification trees as individual classifiers. Once these classifiers have been trained, they can be used to predict on new data. Also, cross validation predictions can be done. This version 2.0 adds a new function "margins" to calculate the margins for these classifiers. Also a higher flexibility is achieved giving access to the "rpart.control" argument of "rpart".

Arguments

Details

ll{ Package: adabag Type: Package Version: 2.0 Date: 2011-07-08 License: GPL(>= 2) LazyLoad: yes }

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, boosting.cv, bagging, predict.bagging, bagging.cv, margins

Examples

Run this code
## rpart library should be loaded
library(rpart)
data(iris)
names(iris)<-c("LS","AS","LP","AP","Especies")
iris.adaboost <- adaboost.M1(Especies~LS +AS +LP+ AP, data=iris, boos=TRUE, 
	mfinal=10)

library(rpart)
data(iris)
names(iris)<-c("LS","AS","LP","AP","Especies")
sub <- c(sample(1:50, 25), sample(51:100, 25), sample(101:150, 25))
iris.bagging <- bagging(Especies ~ ., data=iris[sub,], mfinal=10)
iris.predbagging<- predict.bagging(iris.bagging, newdata=iris[-sub,])

Run the code above in your browser using DataLab