Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.adaboost

predict method for adaboost objects


Description

predictions for model corresponding to adaboost.m1 algorithm

Usage

## S3 method for class 'adaboost'
predict(object, newdata, ...)

Arguments

object

an object of class adaboost

newdata

dataframe on which we are looking to predict

...

arguments passed to predict.default

Details

makes predictions for an adaboost object on a new dataset. The target variable is not required for the prediction to work. However, the user must ensure that the test data has the same columns which were used as inputs to fit the original model. The error component of the prediction object(as in pred$error) can be used to get the error of the test set if the test data is labeled.

Value

predicted object, which is a list with the following components

formula

the formula used.

votes

total weighted votes achieved by each class

class

the class predicted by the classifier

prob

a matrix with predicted probability of each class for each observation

error

The error on the test data if labeled, otherwise NA

See Also

Examples

fakedata <- data.frame( X=c(rnorm(100,0,1),rnorm(100,1,1)), Y=c(rep(0,100),rep(1,100) ) )
fakedata$Y <- factor(fakedata$Y)
test_adaboost <- adaboost(Y~X, fakedata, 10)
pred <- predict( test_adaboost,newdata=fakedata)
print(pred$error)
print( table(pred$class,fakedata$Y) )

fastAdaboost

a Fast Implementation of Adaboost

v1.0.0
MIT + file LICENSE
Authors
Sourav Chatterjee [aut, cre]
Initial release
2016-02-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.