lmdk_sel: Tested the Eucl distance in exp_mech
This commit is contained in:
parent
0b1ce3cbbc
commit
5b81702d37
@ -11,6 +11,7 @@ from matplotlib import pyplot as plt
|
||||
import time
|
||||
|
||||
|
||||
def score(data, option):
|
||||
'''
|
||||
The scoring function.
|
||||
|
||||
@ -20,10 +21,11 @@ import time
|
||||
Returns:
|
||||
The score for the option.
|
||||
'''
|
||||
def score(data, option):
|
||||
return (option.sum() - data.sum())
|
||||
# return lmdk_lib.get_norm(data, option)
|
||||
|
||||
|
||||
def exponential(x, R, u, delta, epsilon):
|
||||
'''
|
||||
The exponential mechanism.
|
||||
|
||||
@ -37,7 +39,6 @@ def score(data, option):
|
||||
res - A randomly sampled output.
|
||||
pr - The PDF of all possible outputs.
|
||||
'''
|
||||
def exponential(x, R, u, delta, epsilon):
|
||||
# Calculate the score for each element of R
|
||||
scores = [u(x, r) for r in R]
|
||||
# Normalize the scores between 0 and 1
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
rslt/bgt_cmp/T-drive-sel.pdf
Normal file
BIN
rslt/bgt_cmp/T-drive-sel.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user