comparison scripts/CalcPropNist.py @ 95:2d671ab3b730

Rajout du calcul de la proportion de lettres (min+maj)
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Thu, 11 Feb 2010 12:18:34 -0500
parents 7054d7afb948
children
comparison
equal deleted inserted replaced
94:1b8176e9892e 95:2d671ab3b730
49 elif classe < 36: 49 elif classe < 36:
50 test_maj += 1 50 test_maj += 1
51 elif classe < 62: 51 elif classe < 62:
52 test_min += 1 52 test_min += 1
53 print "Train set:",len(train),"\nchiffres:",float(train_c)/len(train),"\tmajuscules:",\ 53 print "Train set:",len(train),"\nchiffres:",float(train_c)/len(train),"\tmajuscules:",\
54 float(train_maj)/len(train),"\tminuscules:",float(train_min)/len(train) 54 float(train_maj)/len(train),"\tminuscules:",float(train_min)/len(train),\
55 "\nchiffres:", float(train_c)/len(train),"\tlettres:",float(train_maj+train_min)/len(train)
55 56
56 print "\nTest set:",len(test),"\nchiffres:",float(test_c)/len(test),"\tmajuscules:",\ 57 print "\nTest set:",len(test),"\nchiffres:",float(test_c)/len(test),"\tmajuscules:",\
57 float(test_maj)/len(test),"\tminuscules:",float(test_min)/len(test) 58 float(test_maj)/len(test),"\tminuscules:",float(test_min)/len(test),\
59 "\nchiffres:", float(test_c)/len(test),"\tlettres:",float(test_maj+test_min)/len(test)
60
58 61
59 if test_maj+test_min+test_c != len(test): 62 if test_maj+test_min+test_c != len(test):
60 print "probleme avec le test, des donnees ne sont pas etiquetees" 63 print "probleme avec le test, des donnees ne sont pas etiquetees"
61 64
62 if train_maj+train_min+train_c != len(train): 65 if train_maj+train_min+train_c != len(train):