Ejemplo n.º 1
0
 def run_Kd_standard(self, param):
     logging.debug('building Kd_standard...')
     tree = Kd_standard(self.data, param)
     start = time.clock()
     tree.buildIndex()
     end = time.clock()
     logging.info('[T] Kd-standard building time: %.2f' % (end - start))
     return self.query(tree)
Ejemplo n.º 2
0
 def run_Kd_standard(self, param):
     logging.debug('building Kd_standard...')
     tree = Kd_standard(self.data, param)
     start = time.clock()
     tree.buildIndex()
     # tree.adjustConsistency()
     end = time.clock()
     logging.info('[T] Kd-standard building time: %.2f' % (end - start))
     return self.query(tree)
Ejemplo n.º 3
0
def eval_partition(data, param):
    # tree = Grid_standard(data, param)
    # tree = Quad_standard(data, param)
    tree = Kd_standard(data, param)
    tree.buildIndex()

    seed = 1000
    fov_count = 200

    print optimization(tree, fov_count, seed, param)
Ejemplo n.º 4
0
 def run_Kd_noisymean(self, param):
     logging.debug('building Kd_noisymean...')
     param.splitScheme = 'noisyMean'
     tree = Kd_standard(self.data, param)
     start = time.clock()
     tree.buildIndex()
     tree.adjustConsistency()
     end = time.clock()
     logging.info('[T] Kd-noisymean building time: %.2f' % (end - start))
     return self.query(tree)
Ejemplo n.º 5
0
def eval_partition(data, param):
    # tree = Grid_standard(data, param)
    # tree = Quad_standard(data, param)
    tree = Kd_standard(data, param)
    tree.buildIndex()

    seed = 1000
    bandwidth = 1000
    answer = optimization(tree, bandwidth, seed, param)

    print "\n if my knapsack can hold %d bandwidth, i can get %f profit." % (bandwidth,answer[0])
    print "\tby taking item(s): ",
    for i in range(len(answer[1])):
        if (answer[1][i] != 0):
            print i+1,
Ejemplo n.º 6
0
 def run_Kd_noisymean(self, param):
     logging.debug('building Kd_noisymean...')
     param.splitScheme = 'noisyMean'
     tree = Kd_standard(self.data, param)
     start = time.clock()
     tree.buildIndex()
     tree.adjustConsistency()
     end = time.clock()
     logging.info('[T] Kd-noisymean building time: %.2f' % (end - start))
     return self.query(tree)
 def __init__(self, data, param):
     Kd_standard.__init__(self, data, param)
Ejemplo n.º 8
0
 def __init__(self, data, param):
     Kd_standard.__init__(self, data, param)