In [57]:
import pandas as pd

# visualization libraries
import matplotlib.pyplot as plt
from matplotlib import gridspec

# plot the visuals in ipython
%matplotlib inline

In [58]:
probs=[
# 	"koza_01",
# 	"koza_02",
# 	"koza_03",
# 	"lipson_01",
# 	"lipson_02",
# 	"lipson_03",

# 	"nguyen_01",
# 	"nguyen_02",
	"nguyen_03",
	"nguyen_04",
	"nguyen_05",
	"nguyen_06",
# 	"nguyen_07",
# 	"nguyen_08",
    
	"nguyen_09",
# 	"nguyen_10",
# 	"nguyen_11",
	"nguyen_12",

# 	"korns_01",
# 	"korns_02",
	"korns_03",
# 	"korns_04",
# 	"korns_05",
# 	"korns_06",
# 	"korns_07",
# 	"korns_08",
# 	"korns_09",
# 	"korns_10",
# 	"korns_11",
# 	"korns_12",
# 	"korns_13",
# 	"korns_14",
# 	"korns_15"
]

In [81]:
directory = "/Users/tony/pypge/experiments/output/expand_levels/"

def process_setting_dir(s):
    cdata = {}
    for p in probs:
        prob_out_dir = directory + "config_explicit_" + s + ".yml/clean/" + p + "/out/"
        cdf = pd.read_csv(prob_out_dir + "pge_errs.log", delim_whitespace=True)
        cdata[p] = cdf

    pdf = pd.Panel(cdata)
#     print s + " loaded"
    return pdf

def graphit(YS, title, ax1, varname, loglin):
    ax1.set_xlabel('iteration')
    ax1.set_ylabel(varname)
#     ax1.set_title(title)
    ax1.set_yscale(loglin)
    YS.plot(ax=ax1, legend=False)


def graph_settings(settings):
    for i,s in enumerate(settings):
        fig = plt.figure()
        fig.set_size_inches(12,4)
        fig.suptitle(s)
        gs = gridspec.GridSpec(2,3)

        sdata = process_setting_dir(s)
        
        ys1 = sdata.minor_xs("elapsed_seconds")
        ax1 = fig.add_subplot(gs[:,0])
        graphit(ys1,s,ax1,"elapsed_seconds","log")

        ys1 = sdata.minor_xs("best_size")
        ax1 = fig.add_subplot(gs[:,1])
        graphit(ys1,s,ax1,"best_size","linear")

        ys2 = sdata.minor_xs("best_err")
        ax2 = fig.add_subplot(gs[:,2])
        graphit(ys2,s,ax2,"best_err","log")

        lgd = plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
        plt.tight_layout()
        plt.savefig("images/"+s+".png", dpi=200, bbox_extra_artists=(lgd,), bbox_inches='tight')
        plt.show()

In [82]:
settings1 = [
    "Glow_Smed_Xfalse_L4_T1",
    "Glow_Shigh_Xfalse_L4_T1",
    "Gmed_Smed_Xfalse_L4_T1",
    "Gmed_Shigh_Xfalse_L4_T1",
]

settings2 = [
    "Glow_Smed_Xtrue_L4_T1",
    "Glow_Shigh_Xtrue_L4_T1",
    "Gmed_Smed_Xtrue_L4_T1",
    "Gmed_Shigh_Xtrue_L4_T1",
]

graph_settings(settings1)
graph_settings(settings2)


print "done"


done

In [80]:
settings3 = [
    "Fwout_Glow_Smed_Xfalse_L4_Gmed_Shigh_Xtrue_L4_T2",
    "Fwout_Glow_Smed_Xfalse_L4_Ghigh_Shigh_Xtrue_L4_T2",
    "Fwout_Gmed_Smed_Xfalse_L4_Gmed_Shigh_Xtrue_L4_T2",
    "Fwout_Gmed_Smed_Xfalse_L4_Ghigh_Shigh_Xtrue_L4_T2",
]

settings4 = [
    "Fwith_Glow_Smed_Xfalse_L4_Gmed_Shigh_Xtrue_L4_T2",
    "Fwith_Glow_Smed_Xfalse_L4_Ghigh_Shigh_Xtrue_L4_T2",
    "Fwith_Gmed_Smed_Xfalse_L4_Gmed_Shigh_Xtrue_L4_T2",
    "Fwith_Gmed_Smed_Xfalse_L4_Ghigh_Shigh_Xtrue_L4_T2",
]

graph_settings(settings3)
graph_settings(settings4)


print "done"


done