datasetsnames = np.unique(df_beam.datasetname)
results2plot = dict()
for datname in datasetsnames:
    results2plot[datname] = dict()
    results2plot[datname]["beamsize"] = df_beam[df_beam.datasetname ==
                                                datname].beam_width.to_numpy()
    results2plot[datname]["compression"] = df_beam[
        df_beam.datasetname == datname].length_ratio.to_numpy()
    results2plot[datname]["wkl_sum"] = df_beam[df_beam.datasetname ==
                                               datname].wkl_sum.to_numpy()

fig, lgd = make_graph(results2plot,
                      "beamsize",
                      "compression",
                      size_marker=6,
                      color=tableau20,
                      typeofplot="semilogx",
                      separate_colour=1)
plt.axvline(x=100, linestyle='--', linewidth=0.6, color='k')
plt.xlabel("beam width")
plt.ylabel("relative compression")
save_path = os.path.join(folder_path, "beam_vs_compression.pdf")
fig.savefig(save_path, bbox_extra_artists=(lgd, ), bbox_inches='tight')

###############################################################################
# beamsize  numeric targets
###############################################################################

folder_load = os.path.join("results", "hyperparameter testing",
                           "gaussian_beam_width_results", "summary.csv")
예제 #2
0
results2plot = dict()
for datname in datasetsnames:
    results2plot[datname] = dict()
    results2plot[datname]["maxdepth"] = df[df.datasetname ==
                                           datname].maxdepth.to_numpy()
    results2plot[datname]["compression"] = df[df.datasetname ==
                                              datname].length_ratio.to_numpy()
    results2plot[datname]["time"] = df[df.datasetname ==
                                       datname].runtime.to_numpy()
    results2plot[datname]["conditions"] = df[df.datasetname ==
                                             datname].avg_items.to_numpy()

fig, lgd = make_graph(results2plot,
                      "maxdepth",
                      "compression",
                      size_marker=6,
                      color=tableau20,
                      typeofplot="plot",
                      separate_colour=1)
plt.axvline(x=5, linestyle='--', linewidth=0.6, color='k')
plt.xlabel("maximum depth")
plt.ylabel("relative compression")
save_path = os.path.join(folder_path, "maxdepth_vs_compression.pdf")
fig.savefig(save_path, bbox_extra_artists=(lgd, ), bbox_inches='tight')

fig, lgd = make_graph(results2plot,
                      "maxdepth",
                      "time",
                      size_marker=6,
                      color=tableau20,
                      typeofplot="semilogy",
예제 #3
0
df_ncut = pd.read_csv(folder_load, index_col=False)

datasetsnames = np.unique(df_ncut.datasetname)
results2plot = dict()
for datname in datasetsnames:
    results2plot[datname] = dict()
    results2plot[datname]["ncutpoints"] = df_ncut[
        df_ncut.datasetname == datname].n_cutpoints.to_numpy()
    results2plot[datname]["compression"] = df_ncut[
        df_ncut.datasetname == datname].length_ratio.to_numpy()
    #results2plot[datname]["time"] = df_ncut[df_ncut.datasetname == datname].runtime.to_numpy()

fig, lgd = make_graph(results2plot,
                      "ncutpoints",
                      "compression",
                      size_marker=6,
                      color=tableau20,
                      typeofplot="plot",
                      separate_colour=1)
plt.axvline(x=5, linestyle='--', linewidth=0.6, color='k')
plt.xlabel("number cutpoints")
plt.ylabel("relative compression")
save_path = os.path.join(folder_path, "ncutpoints_vs_compression.pdf")
fig.savefig(save_path, bbox_extra_artists=(lgd, ), bbox_inches='tight')
"""
fig,lgd = make_graph(results2plot,"ncutpoints","time",size_marker = 6,color = tableau20,typeofplot ="semilogy",separate_colour =1)
plt.axvline(x=5,linestyle= '--', linewidth=0.6, color='k')
plt.xlabel("number cutpoints")
plt.ylabel("rumtime (s)")
save_path = os.path.join(folder_path,"ncutpoints_vs_time.pdf")
fig.savefig(save_path, bbox_extra_artists=(lgd,), bbox_inches='tight')