Rfsrc () command in randomForestSRC R package not using multicore functionality

I use R (for Windows 7, 32-bit) to perform text classification using randomForests. Due to the large dataset, I searched the Internet to speed up model building and came across a package randomForestSRC.

I followed all the steps in the package installation guide, but during the execution of the command, rfsrc()only one of the logical cores uses R (the same as randomforest()), the maximum processor utilization is 25%. I used the following command according to the manual.

options(mc.cores=detectcores()-1, rf.cores = detectcores()-1)

I am using Windows 7 Professional 32-bit Service Pack 1 (SP1) on an Intel i3 2120 processor with 4 logical cores. Can anyone shed some light on what I was missing? Any other effective randomForestmulti-core use case will also be useful .

+4
source share
1 answer

, 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.

+3

Source: https://habr.com/ru/post/1584136/


All Articles