-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathsubset_validator.py
41 lines (37 loc) · 3.58 KB
/
subset_validator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# AUTO-GENERATED FILE. DO NOT EDIT
# CodeBuff 1.4.19 'Sat Jun 25 14:50:57 PDT 2016'
#
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.rcParams['text.usetex'] = True
fig = plt.figure()
ax = plt.subplot(111)
N = 30
sizes = range(1,N+1)
sqlite = [0.21495327,0.18803419,0.16371681,0.17863555,0.15,0.14244185,0.12598425,0.14213198,0.12645687,0.13085938,0.122727275,0.10955711,0.11956522,0.105882354,0.12376238,0.11612903,0.117070355,0.10891089,0.11594203,0.12025317,0.11038961,0.12008282,0.10191083,0.10980392,0.10584445,0.10311284,0.110756606,0.10199005,0.11372549,0.11983471]
ax.plot(range(1,len(sqlite)+1), sqlite, label="sqlite", marker='o', color='y')
antlr = [0.26537216,0.20685998,0.18888889,0.17279802,0.18681319,0.16312395,0.17264628,0.16373627,0.15112892,0.16949153,0.16949153,0.16949153]
ax.plot(range(1,len(antlr)+1), antlr, label="antlr", marker='.', color='k')
java_st = [0.15183753,0.12561576,0.07526882,0.07438017,0.072534636,0.072052404,0.044715445,0.066027395,0.06326034,0.056583244,0.062245857,0.056603774,0.06236419,0.055752214,0.0625,0.0529595,0.060189165,0.051327433,0.055793993,0.054545455,0.053435113,0.048034936,0.060090236,0.053982303,0.054030117,0.046551723,0.05453549,0.055555556,0.05263158,0.053435113]
ax.plot(range(1,len(java_st)+1), java_st, label="java\\_st", marker='s', color='g')
java8_guava = [0.08566775,0.055276383,0.04494382,0.03538175,0.032290015,0.03732304,0.028720627,0.032258064,0.026071586,0.028037382,0.024691358,0.025270758,0.020775624,0.025411062,0.01917239,0.02116402,0.020721925,0.020618556,0.019680196,0.019704433,0.021276595,0.023268254,0.018306635,0.02012458,0.020368574,0.021084337,0.017982017,0.018181818,0.018181818,0.014446228]
ax.plot(range(1,len(java8_guava)+1), java8_guava, label="java8\\_guava", marker='d', color='c')
java8_st = [0.17711864,0.099236645,0.07317073,0.08105561,0.0701107,0.080033004,0.06718062,0.060019363,0.06295754,0.043866776,0.04840271,0.05851979,0.06,0.06356968,0.058639072,0.061146148,0.051136363,0.05458895,0.047131147,0.057307377,0.053452116,0.048673946,0.046296295,0.062893085,0.051476978,0.046875,0.0522541,0.06845966,0.05263158,0.055801593]
ax.plot(range(1,len(java8_st)+1), java8_st, label="java8\\_st", marker='+', color='b')
tsql = [0.23728813,0.18735498,0.16167665,0.14594595,0.1444867,0.12602739,0.11612903,0.11553785,0.1175657,0.11951501,0.112716764,0.11062907,0.10626703,0.11764706,0.10580913,0.10738255,0.098242454,0.102345414,0.0996016,0.09859155,0.10358566,0.102639295,0.09756097,0.10358566,0.09068628,0.09243698,0.106687896,0.09647303,0.095744684,0.0996016]
ax.plot(range(1,len(tsql)+1), tsql, label="tsql", marker='p', color='r')
java_guava = [0.10330579,0.05882353,0.056179777,0.052394595,0.04901961,0.035355173,0.033783782,0.042402826,0.030303031,0.032733224,0.03125,0.029268293,0.029288704,0.030595813,0.032967035,0.027848102,0.026910657,0.025046382,0.026498929,0.026536312,0.02855543,0.025227526,0.02116402,0.024691358,0.023114355,0.02174878,0.02504817,0.027777778,0.024324324,0.026933102]
ax.plot(range(1,len(java_guava)+1), java_guava, label="java\\_guava", marker='>', color='m')
ax.tick_params(axis='both', which='major', labelsize=17)
ax.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', alpha=0.5)
ax.set_xlabel("Number of training files in sample corpus subset", fontsize=17)
ax.set_ylabel("Median Error rate for 50 trials", fontsize=17)
#ax.set_title("Effect of Corpus size on Median Leave-one-out Validation Error Rate")
plt.legend()
plt.tight_layout()
fig.savefig('images/subset_validator.pdf', format='pdf')
plt.show()