Example RcppShark Random Forest throws an exception from a random number generator

I followed this example:

https://www.2021.ai/randsharkmachinelearning/

when executing this command on R:

sharkFit <- SharkRFTrain(X, Y, nTrees = 100) 

I get:

 Error in SharkRFTrain(X, Y, nTrees = 100) : Should not call this. Fix the random numbers generator if you need this. 478 

This exception is thrown from this cpp line:

 trainer.train(model, trainData); 

I suspect the reason is written here:

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

The random number generator has been replaced since R packets should use a random generator from R, and not internal C / C ++. Thus, a direct comparison of the results of algorithms that depend on (pseudo) random numbers cannot be performed.

Is there any way to mitigate this?

tried both versions of R: 3.4.1, 3.3.2

+5
source share
1 answer

I investigated this and was able to narrow it to some extent:

Since I could not fix it, I discovered the problem here: https://github.com/aydindemircioglu/RcppShark/issues/1

+2
source

Source: https://habr.com/ru/post/1270477/


All Articles