I just created 40 imputed data sets using the Amelia package, and they are stored in a.out.
I then used the lapply function to create randomforest models on the data sets:
rf.amelia.out = lapply(a.out$imputations, function(i) randomForest(y + x1+x2, data = i) )
Now I would like to combine these models to make a prediction on a bunch a.test.out, which is a list of amelia imputed data testing data.
I can't figure out how to combine these random forest models. I've tried randomforest combine function like combine(rf.amelia.out)
but that didn't work. The problem is that rf.amelia.out
is not a model object, but neither is rf.amelia.out[1]
.
I also tried to use zelig to automatically combine multiple models:
rf.z.out = zelig(y~x1+x2, data = a.out, model = "rf")
But I don't think zelig supports random forest models.
How do I access and combine the multiple random forest models so that I can make one prediction?