rparallel-processing

Parallel Processing in R in caret


It is given in the caret documentation that to allow parallel processing the following code works

library(doMC) 
registerDoMC(cores = 5) 
## All subsequent models are then run in parallel

But in the latest R version(3.4) the package doMC is not available. Can anyone let me know of any other way to do parallel processing?

Update : What Roman suggested worked. DoMC is not available for windows. For windows use doParallel package cls = makeCluster(no of cores to use) and then registerDoParallel(cls) . Also make sure allowParallel is set to TRUE in trControl.


Solution

  • doMC taps into the power of package multicore to calculate in distributed/parallel mode. This is fine, if you're on supported platforms, which Windows isn't.

    You can use another framework, like parallel which comes shipped with R. To do so, you will need package doParallel which works on all three major platforms.