Beispiel #1
0
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')
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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)
Beispiel #5
0
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)
Beispiel #6
0
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
Beispiel #7
0
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)
Beispiel #8
0
def QRNGtest2(d):
    x = GetAnysizeArray(d)
    y = GetAnysizeArray(d)
    return plotScatter(x, y)