Not sure whether I understand you correctly (and whether this is even a data.table question), but maybe you are looking for `replicate`?
M On 09/24/2014 02:55 PM, Hounkpatin Ozias wrote: > Hello to everyone, > > I am interested in doing some iteration in using Random Forest > (classification purpose) with different value of mtry= 2, 4, 6, 9, 12. I > want to repeat each run 100 times. that is with mtry=2 for example, run > it 100 times. As output, I would like to have the aggregate out of bag > errors (total means over the 100 runs) as well as well as the variable > importance based on this 100 runs aggregated over their OBB errors. One > could try it one by one, report each value but it is very laborious. Is > there anyway to have R run the Random Forest 100 times, and give me as > output the resulting (aggregated means) OOB errors and variable > importance. here was my code. > > r2 <- randomForest(Factor ~ ., data=tr, nodesize = 1,ntree=1000, > importance=TRUE, proximity=TRUE, mtry=2) > #I want a 100 run of this > #get average OOB errors > #get variable importance based on these aggregated OBB errors. > > Thank you very much. > > > > _______________________________________________ > datatable-help mailing list > [email protected] > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help > _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
