evaluation: Re-executed some experiments

This commit is contained in:
Manos Katsomallos 2021-10-11 01:12:35 +02:00
parent f84cfb205d
commit f48dca02aa
18 changed files with 39 additions and 35 deletions

View File

@ -68,29 +68,30 @@ def main(args):
for _ in range(args.iter):
lmdks, eps_out = lmdk_sel.find_lmdks(seq, lmdks, epsilon)
lmdks_sel, eps_out = lmdk_sel.find_lmdks(seq, lmdks, epsilon)
# Skip
rls_data_s, bgts_s = lmdk_bgt.skip_cont(seq, lmdks, eps_out)
rls_data_s, bgts_s = lmdk_bgt.skip_cont(seq, lmdks_sel, eps_out)
# lmdk_bgt.validate_bgts(seq, lmdks, epsilon, bgts_s)
mae_s[i] += (lmdk_bgt.mae_cont(rls_data_s)/args.iter)*100
# Uniform
rls_data_u, bgts_u = lmdk_bgt.uniform_cont(seq, lmdks, eps_out)
rls_data_u, bgts_u = lmdk_bgt.uniform_cont(seq, lmdks_sel, eps_out)
# lmdk_bgt.validate_bgts(seq, lmdks, epsilon, bgts_u)
mae_u[i] += (lmdk_bgt.mae_cont(rls_data_u)/args.iter)*100
# Adaptive
rls_data_a, _, _ = lmdk_bgt.adaptive_cont(seq, lmdks, eps_out, .5, .5)
rls_data_a, _, _ = lmdk_bgt.adaptive_cont(seq, lmdks_sel, eps_out, .5, .5)
mae_a[i] += (lmdk_bgt.mae_cont(rls_data_a)/args.iter)*100
# Calculate once
if i == 0:
if pct == lmdks_pct[0]:
# Event
rls_data_evt, _ = lmdk_bgt.uniform_cont(seq, lmdk_lib.find_lmdks_cont(lmdk_data, seq, uid, 0), epsilon)
rls_data_evt, _ = lmdk_bgt.uniform_cont(seq, lmdks, epsilon)
mae_evt += (lmdk_bgt.mae_cont(rls_data_evt)/args.iter)*100
elif pct == lmdks_pct[-1]:
# User
rls_data_usr, _ = lmdk_bgt.uniform_cont(seq, lmdk_lib.find_lmdks_cont(lmdk_data, seq, uid, 100), epsilon)
rls_data_usr, _ = lmdk_bgt.uniform_cont(seq, lmdks, epsilon)
mae_usr += (lmdk_bgt.mae_cont(rls_data_usr)/args.iter)*100
plt.axhline(

View File

@ -80,12 +80,13 @@ def main(args):
mae_a[i] += (lmdk_bgt.mae_cont(rls_data_a)/args.iter)*100
# Calculate once
if i == 0:
if pct == lmdks_pct[0]:
# Event
rls_data_evt, _ = lmdk_bgt.uniform_cont(seq, lmdk_lib.find_lmdks_cont(lmdk_data, seq, uid, 0), epsilon)
rls_data_evt, _ = lmdk_bgt.uniform_cont(seq, lmdks, epsilon)
mae_evt += (lmdk_bgt.mae_cont(rls_data_evt)/args.iter)*100
elif pct == lmdks_pct[-1]:
# User
rls_data_usr, _ = lmdk_bgt.uniform_cont(seq, lmdk_lib.find_lmdks_cont(lmdk_data, seq, uid, 100), epsilon)
rls_data_usr, _ = lmdk_bgt.uniform_cont(seq, lmdks, epsilon)
mae_usr += (lmdk_bgt.mae_cont(rls_data_usr)/args.iter)*100
plt.axhline(

View File

@ -48,7 +48,7 @@ def main(args):
# The y axis
plt.ylabel('Mean absolute error (kWh)') # Set y axis label.
plt.yscale('log')
plt.ylim(.1, 10000)
plt.ylim(.1, 100000)
# Bar offset
x_offset = -(bar_width/2)*(n - 1)
@ -80,13 +80,13 @@ def main(args):
mae_a[i] += lmdk_bgt.mae_cons(seq, rls_data_a)/args.iter
# Calculate once
if pct == lmdks_pct[0]:
# Event
if i == 0:
rls_data_evt, _ = lmdk_bgt.uniform_cons(seq, seq[seq[:, 1] < lmdks_th[0]], epsilon)
rls_data_evt, _ = lmdk_bgt.uniform_cons(seq, lmdks, epsilon)
mae_evt += lmdk_bgt.mae_cons(seq, rls_data_evt)/args.iter
elif pct == lmdks_pct[-1]:
# User
if i == 0:
rls_data_usr, _ = lmdk_bgt.uniform_cons(seq, seq[seq[:, 1] < lmdks_th[len(lmdks_th)-1]], epsilon)
rls_data_usr, _ = lmdk_bgt.uniform_cons(seq, lmdks, epsilon)
mae_usr += lmdk_bgt.mae_cons(seq, rls_data_usr)/args.iter
plt.axhline(

View File

@ -46,7 +46,7 @@ def main(args):
# The y axis
plt.ylabel('Mean absolute error (kWh)') # Set y axis label.
plt.yscale('log')
plt.ylim(.1, 10000)
plt.ylim(.1, 100000)
# Bar offset
x_offset = -(bar_width/2)*(n - 1)
@ -75,13 +75,13 @@ def main(args):
mae_a[i] += lmdk_bgt.mae_cons(seq, rls_data_a)/args.iter
# Calculate once
if pct == lmdks_pct[0]:
# Event
if i == 0:
rls_data_evt, _ = lmdk_bgt.uniform_cons(seq, seq[seq[:, 1] < lmdks_th[0]], epsilon)
rls_data_evt, _ = lmdk_bgt.uniform_cons(seq, lmdks, epsilon)
mae_evt += lmdk_bgt.mae_cons(seq, rls_data_evt)/args.iter
elif pct == lmdks_pct[-1]:
# User
if i == 0:
rls_data_usr, _ = lmdk_bgt.uniform_cons(seq, seq[seq[:, 1] < lmdks_th[len(lmdks_th)-1]], epsilon)
rls_data_usr, _ = lmdk_bgt.uniform_cons(seq, lmdks, epsilon)
mae_usr += lmdk_bgt.mae_cons(seq, rls_data_usr)/args.iter
plt.axhline(

View File

@ -70,7 +70,7 @@ def main(args):
# The y axis
plt.ylabel('Mean absolute error (m)') # Set y axis label.
plt.yscale('log')
# plt.ylim(1, 100000000)
plt.ylim(1, 1000000)
# Bar offset
x_offset = -(bar_width/2)*(n - 1)
@ -101,12 +101,13 @@ def main(args):
rls_data_a, _, _ = lmdk_bgt.adaptive(seq, lmdks, eps_out, .5, .5)
mae_a[i] += lmdk_bgt.mae(seq, rls_data_a)/args.iter
# Calculate once
if lmdk == min(data_info[d]['lmdks']):
# Event
if lmdk == 0:
rls_data_evt, _ = lmdk_bgt.uniform_r(seq, lmdks, bgt['epsilon'])
mae_evt += lmdk_bgt.mae(seq, rls_data_evt)/args.iter
elif lmdk == max(data_info[d]['lmdks']):
# User
if lmdk == 100:
rls_data_usr, _ = lmdk_bgt.uniform_r(seq, lmdks, bgt['epsilon'])
mae_usr += lmdk_bgt.mae(seq, rls_data_usr)/args.iter

View File

@ -68,7 +68,7 @@ def main(args):
# The y axis
plt.ylabel('Mean absolute error (m)') # Set y axis label.
plt.yscale('log')
# plt.ylim(1, 100000000)
plt.ylim(1, 1000000)
# Bar offset
x_offset = -(bar_width/2)*(n - 1)
@ -103,12 +103,13 @@ def main(args):
# mae_d[i] += lmdk_bgt.mae(seq, rls_data_a)/args.iter
# s_d += s_d_c/args.iter
# Calculate once
if lmdk == min(data_info[d]['lmdks']):
# Event
if lmdk == 0:
rls_data_evt, _ = lmdk_bgt.uniform_r(seq, lmdks, bgt['epsilon'])
mae_evt += lmdk_bgt.mae(seq, rls_data_evt)/args.iter
elif lmdk == max(data_info[d]['lmdks']):
# User
if lmdk == 100:
rls_data_usr, _ = lmdk_bgt.uniform_r(seq, lmdks, bgt['epsilon'])
mae_usr += lmdk_bgt.mae(seq, rls_data_usr)/args.iter

View File

@ -558,10 +558,10 @@ def skip_cont(seq, lmdks, epsilon):
# Add noise
o = lmdk_lib.randomized_response(is_landmark, bgts[i])
if is_landmark:
bgts[i] = 0
if i > 0:
# Approximate with previous
o = rls_data[i - 1][1]
bgts[i] = 0
rls_data[i] = [is_landmark, o]
return rls_data, bgts

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.