lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Using existing numpy RandomState

Open vene opened this issue 9 years ago • 2 comments

The _get_random_state implementation in base.py forces all estimators to only take integer seed values for the random_state attribute. I'd like the functionality to pass an existing RandomState object. This is useful when using lightning objects as part of other estimators.

Unfortunately I'm not sure if this is compatible with the randomkit backport here.

vene avatar Mar 09 '16 00:03 vene

Can we set the internal state of lightning's random state from numpy's?

BTW, oiriginally I added the randomkit backport so that we can use randint in tight loops. However, this can also be achieved by generating a random array before the loop. So, with a bit of work, we could possibly remove the randomkit if necessary.

mblondel avatar Mar 09 '16 04:03 mblondel

I guess we should add this set_state to the backport. I will try it out.

vene avatar Mar 10 '16 19:03 vene