我按照这个例子:
https://www.2021.ai/randsharkmachinelearning/
在R上运行此命令时:
sharkFit <- SharkRFTrain(X, Y, nTrees = 100)
我明白了:
Error in SharkRFTrain(X, Y, nTrees = 100) :
Should not call this. Fix the random numbers generator if you need this. 478
此异常是从这个&#34; cpp&#34;行:
trainer.train(model, trainData);
我怀疑原因写在这里:
https://github.com/aydindemircioglu/RcppShark#notes
随机数生成器被替换,因为R包必须使用R中的随机生成器而不是C / C ++内部生成器。因此,无法完成依赖于(伪)随机数的算法结果的直接比较。
有没有办法减轻这种情况?
尝试了两个R版本:3.4.1,3.3.2
答案 0 :(得分:2)
我对此进行了调查,并且能够将其缩小到某种程度:
由于我无法解决问题,我在此处提出了一个问题:https://github.com/aydindemircioglu/RcppShark/issues/1