require(rpart) #the function "rpart" implements the estimation of trees require(MASS) #For the iris data example require(mboost) #The implementation chosen for boosting data(iris) ##Setting cp, the complexity parameter, irisTree <- rpart(Species~.,data=iris,cp=0.001) plot(irisTree,margin=0.1) text(irisTree,use.n=TRUE) printcp(irisTree) ###Note that for classification, mboost relies on the encoding of y as +1 and -1 iris.tree <- rpart(Species~.,data=iris) ?blackboost ?glmboost ?gamboost