lmdk_bgt: Added uniform_cont

This commit is contained in:
Manos Katsomallos 2021-09-29 02:20:11 +02:00
parent ecd7719616
commit 76a95f6a0a

View File

@ -545,6 +545,18 @@ def uniform_r(seq, lmdks, epsilon):
return rls_data, bgts
def uniform_cont(seq, lmdks, epsilon):
# Released
rls_data = [None]*len(seq)
# Budgets
bgts = uniform(seq, lmdks, epsilon)
for i, p in enumerate(seq):
r = p[2] in lmdks
# [original, perturbed]
rls_data[i] = [r, lmdk_lib.randomized_response(r, bgts[i])]
return rls_data, bgts
def utility_analysis(seq, lmdks, o, epsilon):
'''
Analyze the utility.