foreach - R parallel computing inconsistent results -


i trying speed r script using parallel processing since computationally demanding.

after research , testing, have (i think !) got working. however, output different every time run foreach loop on exact same data. doing wrong ?

cl <- makecluster(detectcores()-2)

registerdosnow(cl)

x <- foreach(i = 1:35, .combine = "c") %dopar% {

my code ...

return(percentageerror)}

inside code body doing machine learning on data set, , returning percentage error.

my returned percentageerror result different every time run code.

what ideally result of each loop iteration stored, , once loop has finished, calculate mean of stored results.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -