-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MINOR] Use <= for clarity in Pi examples' Monte Carlo process #15687
Conversation
In theory, it doesn't matter because the circumference has 0 width, but in practice it could matter a very very small bit because of floating-point round-off. It doesn't really matter for purposes of the example but I agree it'd be nice to do the slightly more accurate thing, on principle. I made an even simpler test to isolate away other effects:
I get exactly the same error of 2.910410207057623E-6 in both cases after 1 billion iterations. Therefore I'd suspect any difference is due to chance, but I'm not sure what kind of results you got or whether they're highly unlikely to be due to chance. |
Hey, |
Out of curiosity do you remember how many times one was bigger than the other? if it was 10/10 then you probably have a point, and that there's something about the way the example actually executes that makes this an issue. If it was like 7/10 that is within the realm of chance, says the binomial distribution. It is a good point to be sure and I wouldn't even mind changing it; I guess I'd just leave it unless we think it's actually inaccurate, esp. considering it's just a 'load test' example. |
It was exactly 7/10. Realising '<=' made the concept clearer to me (as I'm 2016-11-01 10:40 GMT+01:00 Sean Owen [email protected]:
Maria Rydzy |
There are actually 4 instances of the Pi example. I'll merge it if you update them all, just for reasons of clarity, sure. If you would update the title to something like |
Thank you Sean! I've updated Scala, Java and Python examples and changed the commit name as you've requested. I can't seem to find the fourth example though. |
There's one more in |
Ok, LocalPi updated and commits squashed. Hope it's fine now. |
Jenkins test this please |
Test build #67904 has finished for PR 15687 at commit
|
Merged to master |
## What changes were proposed in this pull request? If my understanding is correct we should be rather looking at closed disk than the opened one. ## How was this patch tested? Run simple comparison, of the mean squared error of approaches with closed and opened disk. https://gist.github.com/mrydzy/1cf0e5c316ef9d6fbd91426b91f1969f The closed one performed slightly better, but the tested sample wasn't too big, so I rely mostly on the algorithm understanding. Author: Maria Rydzy <[email protected]> Closes apache#15687 from mrydzy/master.
What changes were proposed in this pull request?
If my understanding is correct we should be rather looking at closed disk than the opened one.
How was this patch tested?
Run simple comparison, of the mean squared error of approaches with closed and opened disk.
https://gist.github.com/mrydzy/1cf0e5c316ef9d6fbd91426b91f1969f
The closed one performed slightly better, but the tested sample wasn't too big, so I rely mostly on the algorithm understanding.