Stochastic training of data set