我是R的新手(第2天),他的任务是建造一片随意的森林.每个随机森林将使用不同的训练集建立,我们将结束所有森林进行预测.我在R中实现这个,并且在使用不使用相同集合构建的两个森林时遇到一些困难.我的尝试如下:
d1 = read.csv("../data/rr/train/10/chunk0.csv",header=TRUE)
d2 = read.csv("../data/rr/train/10/chunk1.csv",header=TRUE)
rf1 = randomForest(A55~., data=d1, ntree=10)
rf2 = randomForest(A55~., data=d2, ntree=10)
rf = combine(rf1,rf2)
Run Code Online (Sandbox Code Playgroud)
这当然会产生错误:
Error in rf$votes + ifelse(is.na(rflist[[i]]$votes), 0, rflist[[i]]$votes) :
non-conformable arrays
In addition: Warning message:
In rf$oob.times + rflist[[i]]$oob.times :
longer object length is not a multiple of shorter object length
Run Code Online (Sandbox Code Playgroud)
我已经浏览网页一段时间了解这一点,但尚未取得任何成功.这里的任何帮助将非常感激.