tweak subsample to take in command line arguments. Also support min count for each label