add random generator callback

I propose to add a random generator callback.
It allows to get reproducible results when using cross-validation.
Regards