changeset 18:6a34565c8a74

sort the label list
author Dan Stowell <danstowell@users.sourceforge.net>
date Fri, 07 Dec 2012 12:02:00 +0000
parents a7c4cc56ac6f
children 08f6c2948349
files smacpy.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/smacpy.py	Fri Dec 07 11:39:13 2012 +0000
+++ b/smacpy.py	Fri Dec 07 12:02:00 2012 +0000
@@ -190,7 +190,7 @@
 	else:
 		# This runs "stratified leave-one-out crossvalidation": test multiple times by leaving one-of-each-class out and training on the rest.
 		# First we need to build a list of files grouped by each classlabel
-		labelsinuse = list(set(wavsfound['trainpath'].values()))
+		labelsinuse = sorted(list(set(wavsfound['trainpath'].values())))
 		grouped = {label:[] for label in labelsinuse}
 		for wavpath,label in wavsfound['trainpath'].items():
 			grouped[label].append(wavpath)