Skip to content

Commit

Permalink
Add plotting details (#34)
Browse files Browse the repository at this point in the history
* switch to auroc

* sticking with AUPRC
  • Loading branch information
nwlandry authored Apr 23, 2024
1 parent a51e9d3 commit a595934
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 13 deletions.
Binary file modified Figures/Fig1/fig1.pdf
Binary file not shown.
Binary file modified Figures/Fig2/fig2.pdf
Binary file not shown.
Binary file modified Figures/Fig2/fig2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Fig3/fig3.pdf
Binary file not shown.
Binary file modified Figures/Fig3/fig3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Figures/Fig4/fig4.pdf
Binary file not shown.
Binary file modified Figures/Fig5/fig5.pdf
Binary file not shown.
Binary file modified Figures/Fig5/fig5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plot_fig1.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@

cbar_ax = fig.add_axes([0.91, 0.15, 0.015, 0.31]) # x, y, width, height
cbar = plt.colorbar(c, cax=cbar_ax)
cbar.set_label(r"AUPRC", fontsize=axislabel_fontsize, rotation=270, labelpad=10)
cbar.set_label(measure.upper(), fontsize=axislabel_fontsize, rotation=270, labelpad=10)
cbar_ax.set_yticks([0, 1], [0, 1], fontsize=tick_fontsize)

plt.savefig("Figures/Fig1/fig1.png", dpi=1000)
Expand Down
8 changes: 5 additions & 3 deletions plot_fig2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

axis_limits = [0, 1]

measure = "auprc"

fs.set_fonts()
fs.set_colors()
cmap = fs.cmap
Expand Down Expand Up @@ -85,7 +87,7 @@ def visualize_networks(i, ax):
var = np.array(data[keys[i]], dtype=float)
b = np.array(data["beta"], dtype=float)

performance = np.array(data["auprc"], dtype=float)
performance = np.array(data[measure], dtype=float)

# plot the difference in auprc
mean_difference = performance[1].mean(axis=2).T - performance[0].mean(axis=2).T
Expand Down Expand Up @@ -139,12 +141,12 @@ def visualize_networks(i, ax):

cbar_ax1 = fig.add_axes([0.85, 0.4, 0.015, 0.25])
cbar = fig.colorbar(im1, cax=cbar_ax1)
cbar.set_label(r"$ \Delta \,\mathregular{AUPRC}$", rotation=270, labelpad=10)
cbar.set_label(rf"$\Delta$ {measure.upper()}", rotation=270, labelpad=10)
cbar_ax1.set_yticks([-0.5, 0, 0.5])

cbar_ax2 = fig.add_axes([0.86, 0.1, 0.015, 0.25])
cbar = fig.colorbar(im2, cax=cbar_ax2)
cbar.set_label(r"$\Delta\, \phi(\rho)$", rotation=270, labelpad=10)
cbar.set_label(r"$\Delta\, \phi_{\rho}$", rotation=270, labelpad=10)
cbar_ax2.set_yticks([-0.5, 0, 0.5])

for i, m in enumerate(models):
Expand Down
5 changes: 2 additions & 3 deletions plot_fig3.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@
plt.yticks([-0.2, -0.1, 0, 0.1, 0.2])

plt.legend(frameon=False, loc="upper left")
plt.ylabel(r"$\Delta\,\phi(a_{ij})$")
plt.xlabel(r"$t_{\mathregular{max}}$")
plt.ylabel(r"$\Delta\,\phi_i$")
plt.xlabel(r"$t_{\max}$")
sns.despine()

plt.tight_layout()

plt.savefig("Figures/Fig3/fig3.png", dpi=1000)
Expand Down
6 changes: 3 additions & 3 deletions plot_fig4.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import fig_settings as fs
from lcs import *

metric_name = "auprc"
measure = "auprc"
axis_limits = [0, 1]

axislabel_fontsize = 20
Expand Down Expand Up @@ -110,7 +110,7 @@ def visualize_networks(i, ax):
data = json.load(file)
var = np.array(data[keys[i]], dtype=float)
b = np.array(data["beta"], dtype=float)
recovery_metric = np.array(data[metric_name], dtype=float)
recovery_metric = np.array(data[measure], dtype=float)

if convert_to_log[i]:
var = np.log10(var)
Expand Down Expand Up @@ -143,7 +143,7 @@ def visualize_networks(i, ax):

cbar_ax = fig.add_axes([0.91, 0.1, 0.015, 0.63])
cbar = fig.colorbar(im, cax=cbar_ax)
cbar.set_label(r"AUPRC", fontsize=axislabel_fontsize, rotation=270, labelpad=25)
cbar.set_label(measure.upper(), fontsize=axislabel_fontsize, rotation=270, labelpad=25)
cbar_ax.set_yticks([0, 0.5, 1], [0, 0.5, 1], fontsize=tick_fontsize)

for i, m in enumerate(models):
Expand Down
8 changes: 5 additions & 3 deletions plot_fig5.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import fig_settings as fs
from lcs import *

measure = "auprc"

axis_limits = [0, 1]

fs.set_fonts()
Expand Down Expand Up @@ -89,7 +91,7 @@ def visualize_networks(i, ax):
var = np.array(data[keys[i]], dtype=float)
b = np.array(data["beta"], dtype=float)

performance = np.array(data["auprc"], dtype=float)
performance = np.array(data[measure], dtype=float)

# plot the difference in auprc
mean_difference = performance[2].mean(axis=2).T - performance[0].mean(axis=2).T
Expand Down Expand Up @@ -143,12 +145,12 @@ def visualize_networks(i, ax):

cbar_ax1 = fig.add_axes([0.85, 0.4, 0.015, 0.25])
cbar = fig.colorbar(im1, cax=cbar_ax1)
cbar.set_label(r"$\Delta \,\mathregular{AUPRC}$", rotation=270, labelpad=10)
cbar.set_label(rf"$\Delta$ {measure.upper()}", rotation=270, labelpad=10)
cbar_ax1.set_yticks([-0.5, 0, 0.5])

cbar_ax2 = fig.add_axes([0.85, 0.1, 0.015, 0.25])
cbar = fig.colorbar(im2, cax=cbar_ax2)
cbar.set_label(r"$\Delta\, \phi(\rho)$", rotation=270, labelpad=10)
cbar.set_label(r"$\Delta\, \phi_{\rho}$", rotation=270, labelpad=10)
cbar_ax2.set_yticks([-0.5, 0, 0.5])

for i, m in enumerate(models):
Expand Down

0 comments on commit a595934

Please sign in to comment.