A function to construct an optimal strata for the samples, based on the distribution of the given y.
Useful links