示例#1
0
文件: 1.py 项目: Janie1996/highdim
synthe=Bayes.Sampling(att_num,model_pro,node_num,model,bit_cand_list);

for i in range(len(synthe)):
    synthe[i] = list(map(str, synthe[i]));

file=open('test.txt','w');
for i in synthe:
    for j in i:
        file.write(j);
        file.write(',');
    file.write('\n');
file.close();


'''
Bayes.Conditionals(k,att_num,model_pro);
p_single=Get_Rappor.lasso_regression(bit_cand_list, bitsum_list)
clique=[0,2];
#prob=JunctionTree.independent_marginal(clique, bit_list, bit_cand_list, rowlist, bitsum_list, f, dt)
pro,proe=JunctionTree.getProb(clique, bit_list, bit_cand_list, rowlist, bitsum_list, f, dt)

p_single1 = [sum(eachlist) for eachlist in proe]
p_comb_T = map(list, zip(*proe))
p_single2 = [sum(eachlist) for eachlist in p_comb_T]

print('p single1:',p_single1)
print('p single2:', p_single2)

Mi = Dependency.Get_MI(p_single1, p_single2, proe)
print Mi