在下面的示例中,我嘗試使用missForest來補償缺少的值。爲了加快我使用foreach包的過程。其中我使用了100棵樹,然後我通過那些樹錯過了最後的功能。這是平行missForest的正確方法嗎?Parallel missForest
下面是例子,我做了什麼:在找過了missForest代碼
library(foreach)
library(missForest)
data(iris)
iris.na <- iris
set.seed(111)
## artificially drop some data values.
for (i in 1:4) iris.na[sample(150, sample(20)), i] <- NA
set.seed(222)
system.time(rf <- foreach(ntree=100, .combine=combine,
.multicombine=TRUE,.packages='missForest') %dopar%
{ missForest(iris.na)$ximp})
史蒂夫:你能告訴我怎麼做嗎? – hema
@hema請問如何修改missForest並行執行randomForest? –
是的,如果可以的話請----我多次看到這個問題,從來沒有好的答案。 – hema