yes, i agree. in my scenario, label is my folder name and let suppose i have 10 folder, mean 10 labels, i want 9 labels/folders in training and 1 in test. I think OP asked the same that he want to split based on folders.