rf.combine | R Documentation |
Combine two more more random forests models into a single ensemble.
rf.combine(...)
... |
two or more randomForest class objects as individual objects or a list containing models |
The confusion, err.rate, mse and rsq components (as well as the corresponding components
in the test component, if exist) are averaged across ensembles. This is a modification
of the randomForest combine
function that returns averaged
validation statistics
An object of class randomForest
Jeffrey S. Evans <jeffrey_evans@tnc.org>
randomForest
for randomForest details
combine
for original combine function details
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) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.