Added a function for partitioning data for k-fold cross validation