Skip to content

Commit 491807c

Browse files
committed
plotting
1 parent 7d73afb commit 491807c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

plotting/plot_pareto_ngrams.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ def getAUCTable(df, df_pr_pareto, print_table=False):
358358
df_auc.set_index("method", inplace=True)
359359
df_auc["avg"] = df_auc.mean(axis=1)
360360
df_auc = df_auc.sort_values(by="avg", ascending=False)
361+
df_auc.drop(["avg"], axis=1, inplace=True)
361362

362363
bold_df = df_auc.apply(
363364
lambda x: [
@@ -429,8 +430,8 @@ def get_threshold_df(threshold):
429430

430431
# Plot Precision Recall Pareto frontier for PCBS methods
431432
plotPRPareto(df_pr_paretos, only_high_p=True) #
432-
plt.savefig(base_addr + f"pr_uci.pdf", bbox_inches="tight")
433-
print("plotted pr_uci.pdf")
433+
plt.savefig(base_addr + f"pr_ngrams.pdf", bbox_inches="tight")
434+
print("plotted pr_ngrams.pdf")
434435

435436
# plot single example
436437
threshold = 0.92
@@ -439,17 +440,17 @@ def get_threshold_df(threshold):
439440
getAUCTable(df_pcbs, df_pr_pareto)
440441
ax = plotPRPareto({threshold:df_pr_pareto}, only_high_p=True, ncol=3)
441442
ax.set_title("")
442-
plt.savefig(base_addr + f"pr_uci_{threshold}.pdf", bbox_inches="tight")
443-
print(f"plotted pr_uci_{threshold}.pdf")
443+
plt.savefig(base_addr + f"pr_ngrams_{threshold}.pdf", bbox_inches="tight")
444+
print(f"plotted pr_ngrams_{threshold}.pdf")
444445

445446
# Plot F_0.5 runtime Pareto frontier for PCBS methods
446447
clusterers = df_pcbs["Clusterer Name"].unique()
447448
dfs, graphs = GetParetoDfs(df_pcbs)
448449
ax = plotPareto(dfs, graphs, clusterers, draw_legend=False)
449450
ax.set_title("")
450451
plt.tight_layout()
451-
plt.savefig(base_addr + f"time_f1_uci_{threshold}.pdf", bbox_inches="tight")
452-
print(f"plotted time_f1_uci_{threshold}.pdf")
452+
plt.savefig(base_addr + f"time_f1_ngrams_{threshold}.pdf", bbox_inches="tight")
453+
print(f"plotted time_f1_ngrams_{threshold}.pdf")
453454

454455
if __name__ == "__main__":
455456
base_addr = "results/"

0 commit comments

Comments
 (0)