Search code examples
rboosting

How to install boosting.m1 package in R?


How can I use the function adaboost.M1? I am testing the following codes in R. But I always have the error message: Error: could not find function "adaboost.M1". What packages do I miss? Thanks

library(rpart)
library(mlbench)
library(adabag)
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)

Solution

  • Please try:

    iris.adaboost <- boosting(Species~., data=iris, boos=TRUE, mfinal=10)
    

    Seems that in newer versions of adabag package you have to use method boosting.