effective_xgboost_book icon indicating copy to clipboard operation
effective_xgboost_book copied to clipboard

Mersenne Twister generator in chapter 4

Open fizban99 opened this issue 1 year ago • 0 comments

In chapter 4, the Mersenne Twister generator is used as a parameter of RandomState. According to the documentation, it seems that RandomState directly accepts a seed for its own Mersenne Twister generator, so it would be much simpler to just have:

rs = rn.RandomState(seed=42)

The result is not exactly the same because of the different ways the seed is considered in the two usages. The usage of RandomState shown on the book seems to be its legacy form, but probably is overcomplicating things for NumPy versions newer than 1.16.

fizban99 avatar Jul 07 '23 15:07 fizban99