num_folds = 10
subset_size = len(training) / num_folds
for i in range(num_folds):
    testing_this_round = training[i * subset_size:][:subset_size]
training_this_round = training[:i * subset_size] + training[(i + 1) *
    subset_size:]
How to use the a k-fold cross validation in scikit with naive bayes classifier and NLTK