-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot.py
59 lines (49 loc) · 1.57 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
import matplotlib.pyplot as plt
import cPickle as pickle
import time
with open("classifier2part1.1350.pickle", "rU") as fp:
accs1 = pickle.load(fp)
with open("result2part1.1350.pickle", "rU") as fp:
accs2 = pickle.load(fp)
def plot():
plt.subplot(221)
plt.xlabel("Rules number of current classifier")
plt.ylabel("Accuracy")
plt.title("train")
plt.grid(True)
plt.plot([e[2] for e in accs1], [e[1] for e in accs1], "ko")
plt.plot([e[2] for e in accs1], [e[1] for e in accs1], "r-")
plt.subplot(223)
plt.xlabel("Rules number of current classifier")
plt.ylabel("Samples number")
plt.title("train")
plt.fill_between([e[2] for e in accs1], [e[3] for e in accs1], 10208, label="covered")
plt.fill_between([e[2] for e in accs1], 0, [e[3] for e in accs1], label="uncovered")
plt.legend()
plt.subplot(222)
plt.xlabel("Rules number of current classifier")
plt.ylabel("Accuracy")
plt.title("test")
plt.grid(True)
plt.plot([e[2] for e in accs2], [e[1] for e in accs2], "ko")
plt.plot([e[2] for e in accs2], [e[1] for e in accs2], "r-")
plt.subplot(224)
plt.xlabel("Rules number of current classifier")
plt.ylabel("Samples number")
plt.title("test")
plt.fill_between([e[2] for e in accs2], [e[3] for e in accs2], 2555, label="covered")
plt.fill_between([e[2] for e in accs2], 0, [e[3] for e in accs2], label="uncovered")
plt.legend()
plt.suptitle("demo " + time.ctime())
plt.show()
def check():
for item in accs2:
print item
def test():
plt.figure(1)
plt.show()
plt.figure(2)
plt.show()
#test()
#check()
plot()