In [21]:
import pandas as pd

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

# plot the visuals in ipython
%matplotlib inline

In [26]:
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 [27]:
directory = "/Users/tony/pypge/experiments/output/basic/stage1/"

cdata = {}
for p in probs:
    prob_out_dir = directory + p + "/out/F_linear__I_low__G_low/"
    cdf = pd.read_csv(prob_out_dir + "pge_errs.log", delim_whitespace=True)
    cdata[p] = cdf
    
clean = pd.Panel(cdata)
print "loaded"


loaded

In [28]:
ys1 = clean[probs[0:7]].minor_xs("best_err")
ys2 = clean[probs[7:14]].minor_xs("best_err")
ys3 = clean[probs[14:18]].minor_xs("best_err")
ys4 = clean[probs[18:25]].minor_xs("best_err")


def graphit(YS, filename):
    fig = plt.figure()
    fig.set_size_inches(8,6)
    gs = gridspec.GridSpec(2,1)
    ax1 = fig.add_subplot(gs[:,0])
    ax1.set_xlabel('iteration')
    ax1.set_ylabel('error')
    YS.plot(ax=ax1)
    plt.yscale("log")
    lgd = plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
    plt.savefig("images/"+filename+".png", dpi=200, bbox_extra_artists=(lgd,), bbox_inches='tight')
    plt.show()

graphit(ys1,"basic_stage1_group1")
graphit(ys2,"basic_stage1_group2")
graphit(ys3,"basic_stage1_group3")
graphit(ys4,"basic_stage1_group4")


print "done"


done