rotationForest
implements an ensemble method where each base classifier (tree) is fit on the principal components of the variables of random partitions of the feature set.rotationForest(x, y, K = round(ncol(x)/3, 0), L = 10, verbose = FALSE,
...)
x
requires two columns.K
that results in three features per subset.rpart
package). The default is 10.rpart.control
. First run library(rpart)
.rotationForest
, which is a list with the following elements:
predict.rotationForest
data(iris)
y <- as.factor(ifelse(iris$Species[1:100]=="setosa",0,1))
x <- iris[1:100,-5]
rF <- rotationForest(x,y)
predict(object=rF,newdata=x)
Run the code above in your browser using DataLab