def plotCoeff(files): names = set() coeffList = {} count = 0 ktotal = 0 total = 0 for ifile in files: for line in open(ifile, 'r'): split = line.split(' ') if len(split) == 4: name = split[1].strip() key = float(split[-2]) val = float(split[-1]) if name not in names: names.add(name) if key < 2500: if key not in coeffList: coeffList[key] = [] if val != -1000 and val > -2: coeffList[key].append(val) else: count += 1 total += val ktotal += 1.0 #plotValues(); #plotValues(scindex, 'scindex.png'); print 'Count', count, (total / ktotal), total, ktotal esorted = sorted(coeffList.items(), key=lambda x: x[0]) toPlot = [] for entry in esorted: for val in entry[1]: toPlot.append((entry[0], val)) plotScatter(toPlot, '# terms on Cat node', 'Dunn Index', 'dindex.png')
def TDtE(a, d): #q=GetAnysizeArray(d) q = [rd.random() for i in range(0, d)] x = Contador(0, d) e = 2.718281828459 y = [(-1 / a) * math.log(q[i]) for i in range(0, d)] plotScatter(x, y)
def testRandomDec(d): ab = np.zeros(d) ord = np.zeros(d) for i in range(0, d): ab[i] = GetRandomDec(800) ord[i] = GetRandomDec(800) x = ab / QRNnorm(800) y = ord / QRNnorm(800) print x print y plots.plotScatter(x, y)
def testRandomDec(d): ab = np.zeros(d) ord = np.zeros(d) digits=1023 for i in range(0, d): ab[i] = GetRandomDec(digits) ord[i] = GetRandomDec(digits) x = ab / QRNnorm(digits) y = ord / QRNnorm(digits) #print x #print y plots.plotScatter(x, y)
def QRPVG_test(digits, dim): ax = [GetRandomDec(digits) for i in range(0, dim - 1)] ay = [GetRandomDec(digits) for i in range(0, dim - 1)] x2 = np.array(ax) + 0. y2 = np.array(ay) + 0. norm = QRNnorm(digits) x = x2 / norm y = y2 / norm return plots.plotScatter(x, y)
def RandomDecGraph(ptos,digits): ab = np.zeros(ptos) ord = np.zeros(ptos) for i in range(0, ptos): ab[i] = GetRandomDec(digits) ord[i] = GetRandomDec(digits) x =str( ab / QRNnorm(digits)) y =str( ord / QRNnorm(digits)) file=open('Xdata.txt','w') file.write(x) file.close() file2 = open('Ydata.txt', 'w') file2.write(y) file2.close() print x print y plots.plotScatter(x, y) return x return y
def QRNG_test(): x1 = GetData(1000) y1 = GetData(1000) x1.extend(GetData(1000)) y1.extend(GetData(1000)) norm = np.zeros(2000) for i in range(0, 2000): norm[i] = 65535 x = np.divide(x1, norm) y = np.divide(y1, norm) return plotScatter(x, y)
def QRNGtest2(d): x = GetAnysizeArray(d) y = GetAnysizeArray(d) return plotScatter(x, y)