-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq4_plot.py
133 lines (108 loc) · 3.42 KB
/
q4_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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import matplotlib.pyplot as plt
import csv
fig = plt.figure(figsize=(8,24))
key = []
value = []
flag = 0 # 0: learning 1: predict
row_count = 0
with open("./dataset/riro.txt", "r") as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
row_count+=1
if (row[0]=="learning"):
continue
elif (row[0]=="predict"):
plt.subplot(4,2,1)
plt.plot(key, value, label="learning (time in secs)")
plt.xlabel("samples")
plt.ylabel("RIRO: learning (time in secs)")
key = []
value = []
else:
key.append(float(row[0]))
value.append(float(row[1]))
plt.subplot(4,2,2)
plt.plot(key,value, label="RIRO: predict (time in millisecs)")
plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)
plt.xlabel("samples")
plt.ylabel("RIDO: predict (time in millisecs)")
# plt.suptitle("Case: RIRO")
key = []
value = []
flag = 0 # 0: learning 1: predict
row_count = 0
with open("./dataset/rido.txt", "r") as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
row_count+=1
if (row[0]=="learning"):
continue
elif (row[0]=="predict"):
plt.subplot(4,2,3)
plt.plot(key, value, label="learning (time in secs)")
plt.xlabel("samples")
plt.ylabel("RIDO: learning (time in secs)")
key = []
value = []
else:
key.append(float(row[0]))
value.append(float(row[1]))
plt.subplot(4,2,4)
plt.plot(key,value, label="predict (time in millisecs)")
plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)
plt.xlabel("samples")
plt.ylabel("RIDO: predict (time in millisecs)")
# plt.suptitle("Case: RIDO")
key = []
value = []
flag = 0 # 0: learning 1: predict
row_count = 0
with open("./dataset/diro.txt", "r") as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
row_count+=1
if (row[0]=="learning"):
continue
elif (row[0]=="predict"):
plt.subplot(4,2,5)
plt.plot(key, value, label="learning (time in secs)")
plt.xlabel("samples")
plt.ylabel("DIRO: learning (time in secs)")
key = []
value = []
else:
key.append(float(row[0]))
value.append(float(row[1]))
plt.subplot(4,2,6)
plt.plot(key,value, label="predict (time in millisecs)")
plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)
plt.xlabel("samples")
plt.ylabel("DIRO: predict (time in millisecs)")
# plt.suptitle("Case: DIRO")
key = []
value = []
flag = 0 # 0: learning 1: predict
row_count = 0
with open("./dataset/dido.txt", "r") as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
row_count+=1
if (row[0]=="learning"):
continue
elif (row[0]=="predict"):
plt.subplot(4,2,7)
plt.plot(key, value, label="learning (time in secs)")
plt.xlabel("samples")
plt.ylabel("DIDO: learning (time in secs)")
key = []
value = []
else:
key.append(float(row[0]))
value.append(float(row[1]))
plt.subplot(4,2,8)
plt.plot(key,value, label="predict (time in millisecs)")
plt.tight_layout(h_pad=0.5, w_pad=0.5, pad=2.5)
plt.xlabel("samples")
plt.ylabel("DIDO: predict (time in millisecs)")
# plt.suptitle("Case: DIDO")
plt.savefig("./figures/q4_new.png", dpi=400)