5

I followed this example:

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

when running 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 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.

Is there a way to mitigate this?

tried both R versions: 3.4.1, 3.3.2

Ophir Carmi
  • 2,701
  • 1
  • 23
  • 42
  • Over at github the question came up how important the random forest feature from shark is for you. The current implementation seems to have some fundamental problem with a new one under way. Are you interested in Shark's random forest in particular, or are you trying to learn about integrating Shark into R in general? Feel free to comment here or join the discussion on github. – Ralf Stubner Aug 15 '17 at 21:49

1 Answers1

2

I have investigated this and was able to narrow it down to some degree:

Since I was not able to fix it, I have opened an issue here: https://github.com/aydindemircioglu/RcppShark/issues/1

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75