def oK(fName='test.pdf'): rFanout = 100 alpha = 0.5 steepD = 0.1 h = 12 om = 1 # oe='5.0E-4' oe = '0.001' ns = 200 t = 1 ts = [11, 12] k = 10 ks = [5, 10, 15, 20] nw = 2 mpts = 20 eps = '0.001' xi = '0.001' # xi ='5.0E-4' maxPNeiByte = 2147483631 # 设置bar参数 barlabels = ['Basic', 'Adv'] xlabel = 'k' xTxts = ['5', '10', '15', '20'] ys = None ylabel = 'seconds' ys = [i * 5 for i in range(6)] # ylim=[10, 10000] yscale = 'linear' # 创建bar对象 bar = Bar(len(ts), xlabel=xlabel, xTxts=xTxts, ylabel=ylabel, yscale=yscale, ys=ys, fName=fName) dir = BasePathOptic + 'k\\' indexs = Data.indexs(dir, rFanout, alpha, steepD, 12, om, oe, ns, 12, k, nw, mpts, eps, xi, maxPNeiByte, numMinCluster=k) for tIndex in range(len(ts)): total = [] for kIndex in range(len(ks)): # data = Data.getData(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], # ks[kIndex], nw, mpts, eps, xi, maxPNeiByte) data = Data.getDataByIndexs(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], ks[kIndex], nw, mpts, eps, xi, indexs=indexs) print(data) total.append(data.timeTotal / 1000) bar.drawBar(barlabels[tIndex], tIndex, total) bar.show()
def dMinpts(fName='test.pdf'): rFanout = 100 alpha = 0.5 steepD = 0.1 h = 12 om = 1 oe = '0.001' ns = 200 t = 1 ts = [1, 2, 3, 4] k = 10 nw = 2 mpts = 5 mptss = [5, 10, 20, 50, 100] eps = '0.001' xi = '0.001' maxPNeiByte = 2147483631 # 设置bar参数 barlabels = ['Basic', 'Adv1', 'Adv2', 'Adv3'] xlabel = 'minpts' xTxts = ['10', '20', '50', '100', '200'] ylabel = 'milliseconds' # 创建bar对象 bar = Bar(4, xlabel=xlabel, xTxts=xTxts, ylabel=ylabel, yscale='log', ylim=[1000, 100000], fName=fName) dir = BasePathDbscan + 'nw_mpts\\' indexs = Data.indexs(dir, rFanout, alpha, steepD, 12, om, oe, ns, 4, k, nw, 20, '0.001', xi, maxPNeiByte, numMinCluster=k) for tIndex in range(len(ts)): timeTotals = [] for mptIndex in range(len(mptss)): # data = Data.getData(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], # k, nw, mptss[mptIndex], eps, xi, maxPNeiByte) data = Data.getDataByIndexs(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], k, nw, mptss[mptIndex], eps, xi, indexs=indexs) print(data) timeTotals.append(data.timeTotal) bar.drawBar(barlabels[tIndex], tIndex, timeTotals) bar.show()
def dHAll(fName='test.pdf', isAll=False): rFanout = 100 alpha = 0.5 steepD = 0.1 h = 15 # hs = ['4', '6', '8', '10', '12', '14', '16'] hs = ['6', '8', '10', '12', '14', '16'] om = 1 oe = '0.001' ns = 200 t = 1 ts = None if isAll: ts = [1, 2, 3, 4] else: ts = [1, 4] k = 10 nw = 2 mpts = 20 eps = '0.001' xi = '0.001' maxPNeiByte = 2147483631 # 设置bar参数 if isAll: barlabels = ['Basic', 'Adv1', 'Adv2', 'Adv3'] else: barlabels = ['Basic', 'Adv3'] xlabel = 'h' ylabel = 'milliseconds' # 创建bar对象 numBar = 2 if isAll: numBar = 4 if isAll: bar = Bar(numBar, widthBar=0.1, spanBars=0.02, xlabel=xlabel, xTxts=hs, ylabel=ylabel, yscale='log', ylim=[1000, 100000], fName=fName) else: bar = Bar(numBar, xlabel=xlabel, xTxts=hs, ylabel=ylabel, yscale='log', ylim=[1000, 100000], fName=fName) dir = BasePathDbscan + 'h_all02\\' indexs = Data.indexs(dir, rFanout, alpha, steepD, 14, om, oe, ns, 4, k, nw, mpts, eps, xi, maxPNeiByte, numMinCluster=k) for tIndex in range(len(ts)): timeTotals = [] for hIndex in range(len(hs)): # data = Data.getData(dir, rFanout, alpha, steepD, hs[hIndex], om, oe, ns, ts[tIndex], # k, nw, mpts, eps, xi, maxPNeiByte, numMinCluster=k) data = Data.getDataByIndexs(dir, rFanout, alpha, steepD, hs[hIndex], om, oe, ns, ts[tIndex], k, nw, mpts, eps, xi, indexs=indexs) print(data) timeTotals.append(data.timeTotal) bar.drawBar(barlabels[tIndex], tIndex, timeTotals) bar.show()
def dEpsilon(fName='test.pdf'): rFanout = 100 alpha = 0.5 steepD = 0.1 h = 12 om = 1 oe = '0.001' ns = 200 t = 1 ts = [1, 2, 3, 4] k = 10 nw = 2 mpts = 20 eps = '0.001' epss = ['1.0E-4', '5.0E-4', '0.001', '0.005', '0.01'] xi = '0.001' maxPNeiByte = 2147483631 # 设置bar参数 barlabels = ['Basic', 'Adv1', 'Adv2', 'Adv3'] xlabel = '$\epsilon$' xTxts = ['0.0001', '0.0005', '0.001', '0.005', '0.01'] ylabel = 'milliseconds' # 创建bar对象 bar = Bar(4, xlabel=xlabel, xTxts=xTxts, xRotateAngle=90, ylabel=ylabel, yscale='log', ylim=[100, 1000000], loc=2, fName=fName) dir = BasePathDbscan + 'eps\\' indexs = Data.indexs(dir, rFanout, alpha, steepD, 12, om, oe, ns, 4, k, nw, mpts, '0.001', xi, maxPNeiByte, numMinCluster=k) for tIndex in range(len(ts)): timeTotals = [] for epsIndex in range(len(epss)): if epsIndex == 0: h = 14 elif epsIndex == 1: h = 14 else: h = 12 # data = Data.getData(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], # k, nw, mpts, epss[epsIndex], xi, maxPNeiByte, numMinCluster=10) data = Data.getDataByIndexs(dir, rFanout, alpha, steepD, h, om, oe, ns, ts[tIndex], k, nw, mpts, epss[epsIndex], xi, indexs=indexs) print(data) timeTotals.append(data.timeTotal) bar.drawBar(barlabels[tIndex], tIndex, timeTotals) bar.show()