Skip to content

Commit

Permalink
unifed HDI to 80%, switched to median AUROC so that it sits closer to…
Browse files Browse the repository at this point in the history
… the middle of said hdi
  • Loading branch information
jg-you committed Apr 30, 2024
1 parent 3dacf93 commit 41fc881
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Binary file modified Figures/Fig1/fig1.pdf
Binary file not shown.
Binary file modified Figures/Fig1/fig1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions plot_fig1.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

err_c1 = np.zeros((2, n))
for i in range(n):
interval = az.hdi(c1_samples[:, i], hdi_prob=0.95)
interval = az.hdi(c1_samples[:, i], hdi_prob=0.8)
x, y = interval
err_c1[0, i] = max(c1_mean[i] - x, 0)
err_c1[1, i] = max(y - c1_mean[i], 0)
Expand All @@ -165,7 +165,7 @@

err_c2 = np.zeros((2, n))
for i in range(n):
interval = az.hdi(c2_samples[:, i], alpha=0.05, roundto=4)
interval = az.hdi(c2_samples[:, i], hdi_prob=0.8)
x, y = interval
err_c2[0, i] = max(c2_mean[i] - x, 0)
err_c2[1, i] = max(y - c2_mean[i], 0)
Expand Down Expand Up @@ -219,12 +219,12 @@
tmax = np.array(data["tmax"], dtype=float)
performance = np.array(data[measure], dtype=float)

ax3.semilogx(tmax, performance[0].mean(axis=1), color="C0", label="Simple")
ax3.semilogx(tmax, performance[1].mean(axis=1), color="C1", label="Complex")
min_idx = np.where((performance[0].mean(axis=1) - performance[1].mean(axis=1)) < 0)[
ax3.semilogx(tmax, np.median(performance[0], axis=1), color="C0", label="Simple")
ax3.semilogx(tmax, np.median(performance[1], axis=1), color="C1", label="Complex")
min_idx = np.where((np.median(performance[0], axis=1) - np.median(performance[1], axis=1)) < 0)[
0
].min()
max_idx = np.where((performance[0].mean(axis=1) - performance[1].mean(axis=1)) < 0)[
max_idx = np.where((np.median(performance[0], axis=1) - np.median(performance[1], axis=1)) < 0)[
0
].max()
print(tmax[min_idx])
Expand All @@ -233,7 +233,7 @@
hdi_a = np.zeros_like(tmax)
hdi_b = np.zeros_like(tmax)
for i in range(len(tmax)):
interval = az.hdi(performance[0, i], hdi_prob=0.95)
interval = az.hdi(performance[0, i], hdi_prob=0.8)
a, b = interval
hdi_a[i] = a
hdi_b[i] = b
Expand All @@ -243,7 +243,7 @@
hdi_a = np.zeros_like(tmax)
hdi_b = np.zeros_like(tmax)
for i in range(len(tmax)):
interval = az.hdi(performance[1, i], hdi_prob=0.95)
interval = az.hdi(performance[1, i], hdi_prob=0.8)
a, b = interval
hdi_a[i] = a
hdi_b[i] = b
Expand All @@ -261,8 +261,8 @@
r"$\mathregular{10^4}$",
],
)
ax3.set_ylim([0, 1])
ax3.set_yticks([0, 0.5, 1], [0, 0.5, 1])
ax3.set_ylim([0.45, 1])
ax3.set_yticks([0.5, 1], [0.5, 1])

ax3.legend(
loc="lower right",
Expand Down

0 comments on commit 41fc881

Please sign in to comment.