部分 数据集
参数设置
def setup_args(args = None):
args.algorithm_name = 'TDG'
# args.algorithm_name = 'HDG'
args.user_num = 1000000
args.attribute_num = 6
args.domain_size = 64
args.epsilon = 0.2
args.dimension_query_volume = 0.5
args.query_num = 20
args.query_dimension = 3
运行结果展示
selected attributes: [1, 2, 4] : [ 0 | 0 63 ] [ 1 | 8 39 ] [ 2 | 4 35 ] [ 3 | 0 63 ] [ 4 | 16 47 ] [ 5 | 0 63 ] real_answer: 781595
selected attributes: [0, 2, 4] : [ 0 | 4 35 ] [ 1 | 0 63 ] [ 2 | 28 59 ] [ 3 | 0 63 ] [ 4 | 28 59 ] [ 5 | 0 63 ] real_answer: 585673
selected attributes: [0, 2, 5] : [ 0 | 28 59 ] [ 1 | 0 63 ] [ 2 | 24 55 ] [ 3 | 0 63 ] [ 4 | 0 63 ] [ 5 | 12 43 ] real_answer: 772872
selected attributes: [3, 4, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 0 63 ] [ 3 | 4 35 ] [ 4 | 28 59 ] [ 5 | 0 31 ] real_answer: 341016
selected attributes: [0, 1, 5] : [ 0 | 24 55 ] [ 1 | 24 55 ] [ 2 | 0 63 ] [ 3 | 0 63 ] [ 4 | 0 63 ] [ 5 | 0 31 ] real_answer: 431978
selected attributes: [1, 3, 5] : [ 0 | 0 63 ] [ 1 | 28 59 ] [ 2 | 0 63 ] [ 3 | 16 47 ] [ 4 | 0 63 ] [ 5 | 12 43 ] real_answer: 800367
selected attributes: [2, 3, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 4 35 ] [ 3 | 20 51 ] [ 4 | 0 63 ] [ 5 | 0 31 ] real_answer: 419416
selected attributes: [2, 3, 4] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 0 31 ] [ 3 | 0 31 ] [ 4 | 32 63 ] [ 5 | 0 63 ] real_answer: 109374
selected attributes: [2, 3, 4] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 0 31 ] [ 3 | 24 55 ] [ 4 | 12 43 ] [ 5 | 0 63 ] real_answer: 454761
selected attributes: [1, 4, 5] : [ 0 | 0 63 ] [ 1 | 24 55 ] [ 2 | 0 63 ] [ 3 | 0 63 ] [ 4 | 0 31 ] [ 5 | 32 63 ] real_answer: 205552
selected attributes: [2, 4, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 12 43 ] [ 3 | 0 63 ] [ 4 | 28 59 ] [ 5 | 28 59 ] real_answer: 694285
selected attributes: [0, 1, 5] : [ 0 | 32 63 ] [ 1 | 12 43 ] [ 2 | 0 63 ] [ 3 | 0 63 ] [ 4 | 0 63 ] [ 5 | 20 51 ] real_answer: 477641
selected attributes: [0, 2, 4] : [ 0 | 12 43 ] [ 1 | 0 63 ] [ 2 | 12 43 ] [ 3 | 0 63 ] [ 4 | 28 59 ] [ 5 | 0 63 ] real_answer: 793486
selected attributes: [2, 3, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 16 47 ] [ 3 | 0 31 ] [ 4 | 0 63 ] [ 5 | 24 55 ] real_answer: 457087
selected attributes: [3, 4, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 0 63 ] [ 3 | 32 63 ] [ 4 | 4 35 ] [ 5 | 8 39 ] real_answer: 372993
selected attributes: [0, 1, 2] : [ 0 | 16 47 ] [ 1 | 4 35 ] [ 2 | 20 51 ] [ 3 | 0 63 ] [ 4 | 0 63 ] [ 5 | 0 63 ] real_answer: 800688
selected attributes: [1, 2, 5] : [ 0 | 0 63 ] [ 1 | 32 63 ] [ 2 | 24 55 ] [ 3 | 0 63 ] [ 4 | 0 63 ] [ 5 | 32 63 ] real_answer: 272277
selected attributes: [2, 4, 5] : [ 0 | 0 63 ] [ 1 | 0 63 ] [ 2 | 12 43 ] [ 3 | 0 63 ] [ 4 | 16 47 ] [ 5 | 16 47 ] real_answer: 953157
selected attributes: [1, 2, 4] : [ 0 | 0 63 ] [ 1 | 28 59 ] [ 2 | 32 63 ] [ 3 | 0 63 ] [ 4 | 24 55 ] [ 5 | 0 63 ] real_answer: 416291
selected attributes: [1, 2, 4] : [ 0 | 0 63 ] [ 1 | 0 31 ] [ 2 | 28 59 ] [ 3 | 0 63 ] [ 4 | 12 43 ] [ 5 | 0 63 ] real_answer: 388719
def generate_attribute_group(self):
attribute_list = [i for i in range(self.args.attribute_num)]
attribute_group_list = list(itertools.combinations(attribute_list, self.group_attribute_num))
self.group_num = len(attribute_group_list)
self.args.group_num = self.group_num
self.AG = attribute_group_list
for i in range(len(self.AG)):
self.AG[i] = list(self.AG[i])