tictac = args.time if tictac: startTime = datetime.now() #variables where the final results will be stored acc_curve = [] prec_curve = [] rec_curve = [] f1_curve = [] #acc_curveWA=[] #prec_curveWA=[] #rec_curveWA=[] #f1_curveWA=[] #create object blog Handler curBlog = flog.Blog(blog) #first_year=earliest year of the data first_year = curBlog.getBlogOriginDate().year #last_year=latest year of the data last_year = curBlog.getBlogLastDate().year nyrs = last_year - first_year #last_year=2013 if v: print "blog's life from " + str(first_year) + " to " + str(last_year) if v: print "///////////////////////////////////////////////////////////" #for each year #fix the hypothetical current year=curr_yr for curr_year in range(first_year, last_year): #get all examples up to curr_yr(included)=pre_train_set #pre_train_set=curBlog.getPostsBetweeDates(str(first_year)+"-01-01",str(curr_year)+"-12-31")
return "F1-measure" if tp=="PRE" or tp=="PREw": return "Precision" if tp=="REC" or tp=="RECw": return "Recall" parser = argparse.ArgumentParser(description='process to evaluate the fall in performance in category prediction over time') parser.add_argument('blog', metavar='blog', type=str, help='location of the blog') args=parser.parse_args() path="latestTAL/predOT-master/results/"+args.blog+"/" #allfiles=os.listdir("latestTAL/predOT-master/results/shots/predictions") #allfiles=next(os.walk(path))[2] #fileIn="../testing/test_correct_nologs/results/coupleofpixels_F1M_predTime.pkl" curBlog=flog.Blog(args.blog) #first_year=earliest year of the data first_year=curBlog.getBlogOriginDate().year #last_year=latest year of the data last_year=curBlog.getBlogLastDate().year nyrs=last_year-first_year for fl in next(os.walk(path))[2]: fileIn=fl output = open(fileIn) restoredVar=cPickle.load(output) fnamep=fileIn.split('_') #print type(restoredVar) #nyrs=[2009,2010,2011,2012,2013,2014,2015]