在R中为整个脚本使用parallel

问题描述

我对整个脚本的并行计算有疑问。我的脚本导入数据,然后在训练和验证数据帧中随机分割,然后进行预处理和验证。我想用许多不同的种子来迭代同一脚本。

是否可以并行执行此操作?这些脚本不会互相干扰。

非常感谢!

seeds <- c(2343242,324256,764865,3524526,574574,75624,15436,674767,4325265,2462626,245264,647474,2465374,4253532,5787462,35636,357484,34524,74859,1352637)

for (i in 1:length(seeds))
  {
  set.seed(seeds[i])
  seed <- seeds[i]
  print(seeds[i])
  
  print("begin import")
  source(file = "import.r")
  print("preprocessing")
  source(file = "preProc.r")
  print("normal")
  source(file = "algorithms and datasets.r")
  print("resampled")
  source(file = "algorithms and datasets up down.r")
  
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)