I know that most people prefer to create separate data sets for training and testing. However, can we perform a stratified split on a data set? By ‘stratified split’, I mean that if I want a 70:30 split on the data set, each class in the set is divided into 70:30 and then the first part is merged to create data set 1 and the second part is merged to create data set 2. While I have seen random splits (like kevinzakka’s script ), I have not seen an example of stratified split yet.
Continuing this, is there a way to access all elements of a single class once the data has been dumped to a data set?