-
Notifications
You must be signed in to change notification settings - Fork 2
/
plot.py
87 lines (84 loc) · 3.55 KB
/
plot.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import matplotlib.pyplot as plt
plt.style.use('seaborn')
violations = [0.008 * i for i in range(1, 11)]
data = [
(0.7067721130221131, 0.7073545217257792),
(0.711455773955774, 0.7093505297098112),
(0.7390202702702703, 0.7425149700598802),
(0.738597972972973, 0.7376017196376478),
(0.7713835995085995, 0.7727621679717488),
(0.7795992014742015, 0.7805926608321818),
(0.7917306511056511, 0.793489943190542),
(0.7992168304668305, 0.8011668969752802),
(0.7992168304668305, 0.8011668969752802),
(0.7992168304668305, 0.8011668969752802),
(0.7303439803439803, 0.7305389221556886),
(0.7122235872235873, 0.7098111469368954),
(0.7359490171990172, 0.7409795793029326),
(0.7607877764127764, 0.7598648856133886),
(0.7683891277641277, 0.7637033625057578),
(0.7844364250614251, 0.7838169814217718),
(0.7947635135135135, 0.796714263780132),
(0.7992552211302212, 0.8010133578995855),
(0.7992552211302212, 0.8010133578995855),
(0.7992552211302212, 0.8010133578995855),
(0.7283476658476659, 0.7286964532473514),
(0.706081081081081, 0.7078151389528635),
(0.7455082923832924, 0.7475817595578075),
(0.7576781326781327, 0.7597113465376938),
(0.7638974201474201, 0.7638569015814525),
(0.7804054054054054, 0.7770612620912022),
(0.7919993857493858, 0.7925687087363734),
(0.8003685503685504, 0.8014739751266697),
(0.8004837223587223, 0.8014739751266697),
(0.800406941031941, 0.8016275142023646),
(0.6888820638820639, 0.6857055120528175),
(0.637323402948403, 0.6394902502686933),
(0.6633522727272727, 0.6576078612006756),
(0.6808968058968059, 0.6798710271764163),
(0.7002840909090909, 0.7015200368493781),
(0.7151412776412777, 0.7181022570244127),
(0.737791769041769, 0.7469676032550284),
(0.7590601965601965, 0.7666206049439582),
(0.7827472358722358, 0.786273606632888),
(0.8031326781326781, 0.8031629049593122),
(0.3894732800982801, 0.3936741900813757),
(0.7116477272727273, 0.7125748502994012),
(0.3505835380835381, 0.35129740518962077),
(0.35929821867321865, 0.35820666359588516),
(0.34751228501228504, 0.3486872409028098),
(0.38640202702702703, 0.39474896361123907),
(0.44502457002457, 0.4524796560724704),
(0.4482493857493858, 0.44940887455857514),
(0.4573095823095823, 0.4581606018731767),
(0.546875, 0.544603101489329),
(0.6084536240786241, 0.6015660985720866),
(0.5774723587223587, 0.5690158145247965),
(0.5309812653562653, 0.5281744203899893),
(0.49132371007371006, 0.4896361123906034),
(0.5571253071253072, 0.552433594349762),
(0.577088452088452, 0.5668662674650699),
(0.668343058968059, 0.6701980654076463),
(0.6646191646191646, 0.6658989712881929),
(0.5700629606879607, 0.581759557807462),
(0.6143273955773956, 0.6146169200061415),
(0.6105651105651105, 0.616305849838784),
(0.5228424447174447, 0.5200368493781667),
(0.5418074324324325, 0.5459849531705819),
(0.5268734643734644, 0.5260248733302626),
(0.5056050368550369, 0.5083678796253647),
(0.6078777641277642, 0.605251036388761),
(0.6375921375921376, 0.63841547673883),
(0.5995853808353808, 0.6046368800859819),
(0.5907171375921376, 0.5998771687394442),
(0.6007754914004914, 0.6003377859665285)
]
alphas = [0., 0.001, 0.01, 0.1, 1.0, 10., 100.]
for i in range(len(alphas)):
accuracy = [test for train, test in data[i*len(violations) : (i+1)*len(violations)]]
plt.plot(violations, accuracy, label=f'alpha={alphas[i]}')
plt.xlabel('Violation')
plt.ylabel('Accuracy')
plt.title('Test')
plt.legend()
plt.show()