Sampling algorithms for data analytics