gpt4 book ai didi

c++ - RcppShark 随机森林示例抛出有关随机数生成器的异常

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:42:44 25 4
gpt4 key购买 nike

我按照这个例子:

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

这个异常是从此“cpp”行抛出的:

trainer.train(model, trainData);

我怀疑原因写在这里:

https://github.com/aydindemircioglu/RcppShark#notes

The random number generator was replaced, as R packages must use the random generator from R and not the C/C++ internal one. Thereffore, a direct comparison of results of algorithms that depend on (pseudo) random numbers cannot be done.

有没有办法缓解这种情况?

尝试了两个 R 版本:3.4.1、3.3.2

最佳答案

我对此进行了调查,并能够在一定程度上缩小范围:

由于我无法修复它,我在这里打开了一个问题:https://github.com/aydindemircioglu/RcppShark/issues/1

关于c++ - RcppShark 随机森林示例抛出有关随机数生成器的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45455318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com