, randomForestSRC mclapply , mclapply Windows. randomForestSRC OpenMP , CRAN, OpenMP.
, :
randomForestSRC OpenMP Windows;- .
randomForest foreach doParallel, foreach:
library(randomForest)
library(doParallel)
workers <- detectCores()
cl <- makePSOCKcluster(workers)
registerDoParallel(cl)
x <- matrix(runif(500), 100)
y <- gl(2, 50)
ntree <- 1000
rf <- foreach(n=rep(ceiling(ntree/workers), workers),
.combine=combine, .multicombine=TRUE,
.packages='randomForest') %dopar% {
randomForest(x, y, ntree=n)
}
Windows, Mac OS X Linux. . foreach.