Пример #1
0
def gmrf_res(var):
    print("GMRF Result {}".format(var.upper()))
    fig, (ax, ax1) = newfig(1.0, subplots=2, sharex=True)
    pl.plot_score(kf_scores, df.columns.values, var, ax, label="GMRF", ylabel="Mean Absolute Error")

    pl.plot_r2(r2, df.columns.values, var, ax1,  xlim=(0, 50), ylim=(-1.1, 1.1), ylabel="$R^2$", xlabel="Time steps (15 mins.)")
    savefig('gmrf_res_{}'.format(var))
Пример #2
0
def comp(var, res1=True, res2=True, r21=True, r22=True, name=None):
    print("Comparaison {}".format(var.upper()))
    fig, (ax, ax1) = newfig(1.0, subplots=2, sharex=True)
    if res1:
        pl.plot_score(kf_scores, df.columns.values, var, ax, label="GMRF", ylabel="Mean Absolute Error")
    if res2:
        pl.plot_score(kf_scores_hybrid, df.columns.values, var, ax, label="HRF", color='orange', xlim=(0, 50), ylabel="Mean Absolute Error")
    ax.legend(loc=0, mode="expand", ncol=2, frameon=False)

    if r21:
        pl.plot_r2(r2, df.columns.values, var, ax1,  xlim=(0, 50), ylim=(-1.1, 1.1), ylabel="$R^2$", xlabel="Time steps (15 mins.)")
    if r22:
        pl.plot_r2(r2_hybrid, df.columns.values, var, ax1, color='orange', xlim=(0, 50), ylim=(-1.1, 1.1), ylabel="$R^2$", xlabel="Time steps (15 mins.)")

    if name:
        savefig(name)
    else:
        savefig('comp_{}'.format(var))