def doit(auser=''): allData = ksdMySQL.loadTable('localhost', 'root', 'wpxk00', 'rhythmpass_web') oldBetter = 0 newBetter = 0 sameCnt = 0 oldC = [] newC = [] debug = 0 if auser != '': debug = 1 cnt = 0 for user, vectors in allData.iteritems(): if auser != '' and auser != user: continue cnt += 1 if debug: print "--------- Old KSD" c1 = getConsistency(vectors, debug) newVectors = rhythmMath.getNewVectors(vectors) if debug: print "--------- new KSD" c2 = getConsistency(newVectors, debug) oldC.append(c1) newC.append(c2) if c1 > c2: newBetter += 1 elif c1 < c2: oldBetter += 1 else: sameCnt += 1 print "%15s %0.3f %0.3f" % (user, c1, c2) print "----------------------------" print "SUM: old= %0.3f new= %0.3f" % ( sum(oldC), sum(newC) ) print "AVG: old= %0.3f new= %0.3f" % ( sum(oldC)/cnt, sum(newC)/cnt ) print "----------------------------" print "Old = %d, New = %d, Even = %d" % (oldBetter, newBetter, sameCnt)
def convAll(allData): #### convert to NEW interval for u, vs in allData.iteritems(): allData[u] = rhythmMath.getNewVectors(vs)