Splitting data into training and test sets while preserving the distribution of categories in each fold.