# Splitting an imbalanced dataset for training and testing

I have a highly imbalanced dataset. My question is how to split the dataset for training and testing? I want to have a separate training set and a separate testing set.

One idea I had is just to shuffle the dataset and then take 70% for training and the rest for testing. Is that good strategy?

• What is the total sample size and the distribution of $Y$? Data splitting requires enormous sample sizes to achieve sufficient stability and precision. Mar 31, 2014 at 12:20