* Shuffle docs before doing jackknife partition --- otherwise we'll not get the right genre mixes...

This commit is contained in:
Matthew Honnibal 2015-05-31 01:25:02 +02:00
parent 4d8d490547
commit d42dda0372

View File

@ -81,6 +81,7 @@ def get_train_tags(Language, model_dir, docs, gold_preproc):
return taggings return taggings
def get_partitions(docs, n_parts): def get_partitions(docs, n_parts):
random.shuffle(docs)
n_test = len(docs) / n_parts n_test = len(docs) / n_parts
n_train = len(docs) - n_test n_train = len(docs) - n_test
for part in range(n_parts): for part in range(n_parts):