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