# Stratified shuffle for normally distributed target variable

When splitting data for a classification problem one is advised to use stratified shuffling in case the target variable is skewed toward a certain class. Indeed, Sklearn has a function for that.

Suppose now that we are splitting the data w.r.t to a target variable T that is normally distributed. Is there any similar tool or technique that could split a the data set into train/val sets so that the mean/variance of T is preserved as much as possible?

I understand that for large enough sets that's already the case but I am interested in practical applications where splitting the data into train/tes/val sets skews the mean and variance by a lot.

• You could just sort the data by the target variable, and then assign every $n$th data to validation set, I think? – Eoin Jan 12 at 18:20
• What do you mean by "stratified shuffling"? The only relevant hit when searching it is the page from the sklearn documentation. I know "stratified sampling", but in that context, I don't understand the question. Is this in context of a classification you have already performed, or is this a theoretical concern? – cherub Jan 13 at 21:06