predict.RRotF: Predict method for RRotF objects.

Description Usage Arguments Value Author(s) References See Also Examples

Description

Prediction of new observations using RRotF model.

Usage

1
2
## S3 method for class 'RRotF'
predict(object, newdata, type = "class")

Arguments

object

An object of class RRotF, as created by the function RRotF.

newdata

A data frame with the same predictors as in the training data.

type

Type of prediction: 'prob' for probabilities and 'class' for class labels.

Value

A vector containing either predicted class probabilities or labels.

Author(s)

Arnu Pretorius: arnupretorius@gmail.com

References

Rodriguez, J.J., Kuncheva, L.I., 2006. Rotation forest: A new classifier ensemble method. IEEE Trans. Pattern Anal. Mach. Intell. 28, 1619-1630. doi:10.1109/TPAMI.2006.211

See Also

RRotF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ElemStatLearn)
library(caret)
data("SAheart")
trainIndex <- createDataPartition(SAheart$chd, p=0.6, list=FALSE)
train <- SAheart[trainIndex,]
test <- SAheart[-trainIndex,]
Xtrain <- train[,-10]
ytrain <- train[,10]
Xtest <- test[,-10]
ytest <- test[,10]
mod <- RRotF(Xtrain, ytrain, model="log")
preds <- predict(mod, Xtest)
error <- mean(preds != ytest)
error

arnupretorius/RRotF documentation built on May 10, 2019, 1:46 p.m.