Please take a look at the [DataGenerator class](https://github.com/shogun-toolbox/shogun/blob/master/src/shogun/features/DataGenerator.cpp) which may appear useful here