Reputation: 45
I've made a script to predict wage based on the variables:gender, age and education. I use the rpart function. When i run the code in 32-bit R, the output differs from the 64-bit R version. The difference is not dramatically, but I can't decide which output is correct.
The data set is quite large (10,000+ entries). because of privacy reasons i'm not permitted to share data/results.
this is the code i use:
set.seed(1234)
tree <-rpart(wage ~ gender + age + education, method='class', data=Data, control=rpart.control(minsplit=1, minbucket=1, cp=0.002))
How can i get the correct output in both versions of R? Can the GMP package help me? If yes, how?
Upvotes: 1
Views: 206
Reputation: 407
You need to manually set the seed parameters. Like this ...
set.seed(1234, kind = "Mersenne-Twister", normal.kind = "Inversion");
mean(rnorm(1000))
This gives the same result on 32 and 64 bit.
Upvotes: 1