Skip to content

Instantly share code, notes, and snippets.

@zachmayer
Created July 22, 2011 13:55
Show Gist options
  • Save zachmayer/1099499 to your computer and use it in GitHub Desktop.
Save zachmayer/1099499 to your computer and use it in GitHub Desktop.
multiRF.R
multiRF <- function(x,...) {
foreach(i=x,.combine=combine,.packages='randomForest',
.export=c('X','Y'),.inorder=FALSE) %dopar% {
randomForest(X,Y,mtry=i,...)
}
}
multiRF(c(rep(3,10),rep(4,10),rep(5,10)),ntree=500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment