Partitioning a dataset into separate training and test sets