RcppShark 随机森林示例引发有关随机数生成器的异常
RcppShark Random Forest example throws exception about the random number generator
我遵循了这个例子:
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
随机数生成器已被替换,因为 R 包必须使用 R 中的随机生成器,而不是 C/C++ 内部生成器。因此,无法对依赖于(伪(随机数的算法结果进行直接比较。
有没有办法缓解这种情况?
尝试了两个 R 版本: 3.4.1, 3.3.2
我已经对此进行了调查,并能够在一定程度上缩小范围:
错误消息- 如下所示:https://github.com/aydindemircioglu/RcppShark/blob/master/src/shark/Rng/Runif.h#L71
- 调用代码在这里:https://github.com/aydindemircioglu/RcppShark/blob/master/src/src/Algorithms/RFTrainer.cpp#L178
由于我无法修复它,我在这里打开了一个问题:https://github.com/aydindemircioglu/RcppShark/issues/1
相关文章:
- 为什么随机数生成器不在void函数中随机化数字,而在main函数中随机化
- 制作具有平均值的随机数生成器
- C++ 随机数生成器:尝试将结果作为向量获取,但通过制作 void 函数来执行此操作而出现错误
- 尝试在 c++ 中创建随机数生成器并收到错误
- 存储并重新加载随机数生成器状态
- 作为随机数生成器的争用条件
- 播种随机数生成器以使用分叉的好方法是什么?
- 随机数生成器的性能因平台而异
- 随机数生成器的种子和状态有什么区别?
- RcppShark 随机森林示例引发有关随机数生成器的异常
- C++多个实例的随机数生成器组种子中增强
- C++随机数生成器仅生成 0 - C++ 11
- GSL+OMP:C++中的线程安全随机数生成器
- 贪吃蛇游戏 - 食物瓷砖的随机数生成器
- 随机数生成器在 C++ 用于 skipList.
- RSA 加密和解密期间的随机数生成器要求
- 如何使用 cpp 设置随机数生成器的语法?
- 产生相同结果的随机数生成器
- C++随机数生成器通常在 Visual Studio 中运行程序时在 2 次后停止生成数字
- 如何理解C++11随机数生成器