2

尝试在 R 中执行并行处理以使用 3 个内核创建 51 棵树的随机森林时,我收到错误 “randomForest(x, y, ntree = ntree) 中的错误:任务 1 失败 -”找不到函数“randomForest””

请帮忙。我使用的代码如下:

library(doParallel)
library(randomForest)
cl<-makeCluster(3)
registerDoParallel(cl)
cl
attach(train)
x<-train[,2:94]
y<-train$target
rf <- foreach(ntree=rep(17, 3), .combine=combine) %dopar% randomForest(x, y, ntree=ntree)
4

0 回答 0