Пример #1
0
output = open(args.output + "/" + blog + '_ACCw_predTime.pkl', 'wb')
cPickle.dump(acc_curveWA, output)
output = open(args.output + "/" + blog + '_PREw_predTime.pkl', 'wb')
cPickle.dump(prec_curveWA, output)
output = open(args.output + "/" + blog + '_RECw_predTime.pkl', 'wb')
cPickle.dump(rec_curveWA, output)
output = open(args.output + "/" + blog + '_F1Mw_predTime.pkl', 'wb')
cPickle.dump(f1_curveWA, output)

#Plot results
#print acc_curve
#xlb,dat_crv,lb_crv=plOT.getScoresCurves(acc_curve,nyrs)
#print xlb
#print dat_crv
xlbWA, dat_crvWA, lb_crvWA = plOT.getScoresCurves(acc_curveWA, nyrs)
legends = ["Years", "Accuracy", "Accuracy of predictions over time"]
#plOT.plotBehaviorN(xlb,dat_crv,lb_crv,legends,"../plots/"+blog+"_acc_svc_ovrtm.png")
plOT.plotBehaviorN(xlbWA, dat_crvWA, lb_crvWA, legends,
                   "../plots/" + blog + "_accWA_svc_ovrtm.png")

#xlb,dat_crv,lb_crv=plOT.getScoresCurves(prec_curve,nyrs)
xlbWA, dat_crvWA, lb_crvWA = plOT.getScoresCurves(prec_curveWA, nyrs)
legends = ["Years", "Precision", "Precision of predictions over time"]
#plOT.plotBehaviorN(xlb,dat_crv,lb_crv,legends,"../plots/"+blog+"_prec_svc_ovrtm.png")
plOT.plotBehaviorN(xlbWA, dat_crvWA, lb_crvWA, legends,
                   "../plots/" + blog + "_precWA_svc_ovrtm.png")

#xlb,dat_crv,lb_crv=plOT.getScoresCurves(rec_curve,nyrs)
xlbWA, dat_crvWA, lb_crvWA = plOT.getScoresCurves(rec_curveWA, nyrs)
legends = ["Years", "recall", "Recall of predictions over time"]
cPickle.dump(rec_curve, output)
output = open(args.output + "/" + blog + '_F1M_predTime.pkl', 'wb')
cPickle.dump(f1_curve, output)

#output = open(args.output+"/"+blog+'_ACCw_predTime.pkl', 'wb')
#cPickle.dump(acc_curveWA, output)
#output = open(args.output+"/"+blog+'_PREw_predTime.pkl', 'wb')
#cPickle.dump(prec_curveWA, output)
#output = open(args.output+"/"+blog+'_RECw_predTime.pkl', 'wb')
#cPickle.dump(rec_curveWA, output)
#output = open(args.output+"/"+blog+'_F1Mw_predTime.pkl', 'wb')
#cPickle.dump(f1_curveWA, output)

#Plot results
#print acc_curve
xlb, dat_crv, lb_crv = plOT.getScoresCurves(acc_curve, nyrs)
#print xlb
#print dat_crv
#xlbWA,dat_crvWA,lb_crvWA=plOT.getScoresCurves(acc_curveWA,nyrs)
legends = ["Years", "Accuracy", "Accuracy of predictions over time"]
plOT.plotBehaviorN(xlb, dat_crv, lb_crv, legends,
                   "../plots/" + blog + "_acc_svc_ovrtm.png")
#plOT.plotBehaviorN(xlbWA,dat_crvWA,lb_crv,legends,"../plots/"+blog+"_accWA_svc_ovrtm.png")

xlb, dat_crv, lb_crv = plOT.getScoresCurves(prec_curve, nyrs)
#xlbWA,dat_crvWA,lb_crvWA=plOT.getScoresCurves(prec_curveWA,nyrs)
legends = ["Years", "Precision", "Precision of predictions over time"]
plOT.plotBehaviorN(xlb, dat_crv, lb_crv, legends,
                   "../plots/" + blog + "_prec_svc_ovrtm.png")
#plOT.plotBehaviorN(xlbWA,dat_crvWA,lb_crv,legends,"../plots/"+blog+"_precWA_svc_ovrtm.png")
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 27 20:53:28 2018

@author: ivan
"""

import cPickle
import plotOverTime as plOT

fileIn="../testing/test_correct_nologs/results/coupleofpixels_F1M_predTime.pkl"

output = open(fileIn)
restoredVar=cPickle.load(output)
print type(restoredVar)
#nyrs=[2009,2010,2011,2012,2013,2014,2015]
nyrs=4

xlb,dat_crv,lb_crv=plOT.getScoresCurves(restoredVar,nyrs)
print dat_crv
print xlb
#xlbWA,dat_crvWA,lb_crvWA=plOT.getScoresCurves(f1_curveWA,nyrs)
legends=["Years","f1-measure","F1-measure of predictions over time"]
plOT.plotBehaviorN(xlb,dat_crv,lb_crv,legends)
#plOT.plotBehaviorN(xlb,dat_crv,lb_crv,legends,"../plots/"+blog+"_f1_svc_ovrtm.png")
#plOT.plotBehaviorN(xlbWA,dat_crvWA,lb_crv,legends,"../plots/"+blog+"_f1WA_svc_ovrtm.png")