lmdk_sel: Trying without Pareto

This commit is contained in:
Manos Katsomallos 2021-10-06 13:30:15 +02:00
parent 079c33ca48
commit ed66d8dddf
4 changed files with 16 additions and 3 deletions

View File

@ -299,6 +299,19 @@ def get_non_opts_from_bottom(seq, lmdks):
def find_lmdks(seq, lmdks, epsilon):
'''
Add dummy landmarks to original landmarks.
Parameters:
seq - All of the data points.
lmdks - The original landmarks.
epsilon - The available privacy budget.
Returns:
lmdks_new - The new landmarks.
The remaining privacy budget.
'''
# The privacy budget to use
eps_sel = 0
if len(lmdks) > 0 and len(seq) != len(lmdks):
# Get landmarks timestamps in sequence
@ -310,10 +323,10 @@ def find_lmdks(seq, lmdks, epsilon):
# Landmarks selection budget
eps_sel = epsilon/(len(lmdks_seq) + 1)
# Get private landmarks timestamps
lmdks_seq, _ = exp_mech.exponential_pareto(hist, opts, exp_mech.score, 1.0, eps_sel)
lmdks_seq, _ = exp_mech.exponential(hist, opts, exp_mech.score, 1.0, eps_sel)
# Get actual landmarks values
lmdks = seq[lmdks_seq]
return lmdks, epsilon - eps_sel
lmdks_new = seq[lmdks_seq]
return lmdks_new, epsilon - eps_sel
def test():
# Start and end points of the sequence