Showing
2 changed files
with
11 additions
and
5 deletions
... | @@ -37,6 +37,10 @@ __author__ = 'egaytan' | ... | @@ -37,6 +37,10 @@ __author__ = 'egaytan' |
37 | def savescreen(output, dic, path): | 37 | def savescreen(output, dic, path): |
38 | if output: | 38 | if output: |
39 | DF.from_dict(dic).to_csv(path+'.csv', sep = "\t", index = True) | 39 | DF.from_dict(dic).to_csv(path+'.csv', sep = "\t", index = True) |
40 | +def plotMax(yvalues, size): | ||
41 | + scorelist = list(yvalues) | ||
42 | + maxscore = max(scorelist) | ||
43 | + plt.plot(scorelist.index(maxscore), maxscore, markersize=size) | ||
40 | 44 | ||
41 | #################################################################################### | 45 | #################################################################################### |
42 | # MAIN PROGRAM # | 46 | # MAIN PROGRAM # |
... | @@ -89,13 +93,15 @@ if __name__ == '__main__': | ... | @@ -89,13 +93,15 @@ if __name__ == '__main__': |
89 | plt.ylabel("score") | 93 | plt.ylabel("score") |
90 | plt.rcParams.update() | 94 | plt.rcParams.update() |
91 | plt.grid() | 95 | plt.grid() |
92 | - plt.plot(scoresTable['precision'],'co--', label='precision', linewidth=1, markersize=6) | 96 | + plt.plot(scoresTable['precision'],'co--', label='precision', linewidth=1, markersize=4) |
93 | - plt.plot(scoresTable['f1-score'], 'bo--', label='F1', linewidth=1, markersize=6) | 97 | + plotMax(scoresTable['precision'], 8) |
94 | - plt.plot(scoresTable['recall'], 'mo--', label='recall' , linewidth=1, markersize=6) | 98 | + plt.plot(scoresTable['f1-score'], 'bo--', label='F1', linewidth=1, markersize=4) |
95 | - plt.plot(scoresTable['CV'], 'ro--', label='CV' , linewidth=1, markersize=6) | 99 | + plt.plot(scoresTable['recall'], 'mo--', label='recall' , linewidth=1, markersize=4) |
100 | + plt.plot(scoresTable['CV'], 'ro--', label='CV' , linewidth=1, markersize=4) | ||
96 | for k,v in dict(scoresTable).items(): | 101 | for k,v in dict(scoresTable).items(): |
97 | for a,b in zip(range(64), v): | 102 | for a,b in zip(range(64), v): |
98 | plt.text(a-0.5, float(b)+0.0020, b[0:6], fontsize=5) | 103 | plt.text(a-0.5, float(b)+0.0020, b[0:6], fontsize=5) |
104 | + #plt.plot(max(scoresTable['precision']), scoresTable['precision'].index(max(scoresTable['precision'])), markersize=8) | ||
99 | plt.legend(loc='upper left') | 105 | plt.legend(loc='upper left') |
100 | - plt.xticks(range(64), list(scoresTable.index)[0:65], rotation=90, fontsize=8) | 106 | + plt.xticks(range(64), list(scoresTable.index)[0:65], rotation=270, fontsize=8) |
101 | fig.savefig(imageName, bbox_inches='tight', pad_inches = 0.3) | 107 | fig.savefig(imageName, bbox_inches='tight', pad_inches = 0.3) | ... | ... |
-
Please register or login to post a comment