Merge branch 'master'
This commit is contained in:
commit
812dc7406f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user