Learn R Programming

rfUtilities (version 2.1-4)

rf.combine: Combine Random Forests Ensembles

Description

Combine two more more random forests models into a single ensemble.

Usage

rf.combine(...)

Arguments

...

two or more randomForest class objects as individual objects or a list containing models

Value

An object of class randomForest

See Also

randomForest for randomForest details

combine for original combine function details

Examples

Run this code
# NOT RUN {
library(randomForest)
data(iris)

c1 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)
c2 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)
c3 <- randomForest(Species ~ ., iris, ntree=50, norm.votes=FALSE)

( class.combine <- rf.combine(c1,c2,c3) )

data(airquality)
set.seed(131)
r1 <- randomForest(Ozone ~ ., data=airquality, mtry=3,
                   importance=TRUE, na.action=na.omit)
r2 <- randomForest(Ozone ~ ., data=airquality, mtry=3,
                   importance=TRUE, na.action=na.omit)
r3 <- randomForest(Ozone ~ ., data=airquality, mtry=3,
                   importance=TRUE, na.action=na.omit)

( regress.combine <- rf.combine(r1,r2,r3) )				   

# }

Run the code above in your browser using DataLab