OKĀ <br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 2, 2020, 10:42 AM Adrin <<a href="mailto:adrin.jalali@gmail.com">adrin.jalali@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">liblinear and libsvm use the C `rand()` function which returns number up to</div><div class="gmail_default" style="font-size:small">32767 on the windows platform. <a href="https://github.com/scikit-learn/scikit-learn/pull/13511" target="_blank" rel="noreferrer">This PR</a> proposes the following fix:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><i>Fixed a convergence issue in ``libsvm`` and ``liblinear`` on Windows platforms</i></div><div class="gmail_default" style="font-size:small"><i>impacting all related classifiers and regressors. The random number generator</i></div><div class="gmail_default" style="font-size:small"><i>used to randomly select coordinates in the coordinate descent algorithm was</i></div><div class="gmail_default" style="font-size:small"><i>C ``rand()``, that is only able to generate numbers up to ``32767`` on windows</i></div><div class="gmail_default" style="font-size:small"><i>platform. It was replaced with C++11 ``mt19937``, a Mersenne Twister that</i></div><div class="gmail_default" style="font-size:small"><i>correctly generates 31bits/63bits random numbers on all platforms. In addition,</i></div><div class="gmail_default" style="font-size:small"><i>the crude "modulo" postprocessor used to get a random number in a bounded</i></div><div class="gmail_default" style="font-size:small"><i>interval was replaced by the tweaked Lemire method as suggested by `this blog</i></div><div class="gmail_default" style="font-size:small"><i>post <<a href="http://www.pcg-random.org/posts/bounded-rands.html" target="_blank" rel="noreferrer">http://www.pcg-random.org/posts/bounded-rands.html</a>>`</i></div><div class="gmail_default" style="font-size:small"><i><br></i></div><div class="gmail_default" style="font-size:small">In order to keep the models consistent across platforms, we'd like to use the same (new) rng</div><div class="gmail_default" style="font-size:small">on all platforms, which means after this change the generated models may be slightly different</div><div class="gmail_default" style="font-size:small">to what they are now. We'd like to hear any concerns on the matter from the community, here</div><div class="gmail_default" style="font-size:small">or on the PR, before merging the fix.<i><br></i></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Best,</div><div class="gmail_default" style="font-size:small">Adrin.<i><br></i></div></div>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank" rel="noreferrer">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>