插入符号中的 R 中的并行处理 [英] Parallel Processing in R in caret
问题描述
插入符号文档中给出允许并行处理以下代码工作
库(doMC)registerDoMC(核心数 = 5)## 然后所有后续模型并行运行
但在最新的 R 版本 (3.4) 中,软件包 doMC 不可用.任何人都可以让我知道进行并行处理的任何其他方式吗?
更新:罗马建议的工作.DoMC 不适用于 Windows.对于 Windows,使用 doParallel 包 cls = makeCluster(no of cores to use)
然后 registerDoParallel(cls)
.还要确保在 trControl 中将 allowParallel 设置为 TRUE.
doMC
利用包 multicore
的力量以分布式/并行模式进行计算.这很好,如果您使用的是受支持的平台,而 Windows 则不是.
您可以使用其他框架,例如 R 附带的 parallel
.为此,您需要包 doParallel
,它适用于所有三个主要平台.>
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.
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.
这篇关于插入符号中的 R 中的并行处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!