generalized the random subsample functions so we can easily extend them to other classifiers