-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·41 lines (36 loc) · 956 Bytes
/
plot.py
File metadata and controls
executable file
·41 lines (36 loc) · 956 Bytes
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
#!/usr/bin/env python
import csv
import sys
import matplotlib.pyplot as plt
f = open(sys.argv[1], 'rb')
reader = csv.DictReader(f)
la = []
ld = []
lc = []
ls = []
lm = []
lx = []
for line in reader:
for lst,e,a in [ [la,'Avegare (Estimated)','Avegare (Actual)'],
[ld,'Stand. Deviation (Estimated)','Stand. Deviation (Actual)'],
[lc,'Count (Estimated)','Count (Actual)'],
[ls,'Sum (Estimated)','Sum (Actual)'],
[lm, 'Min (Estimated)','Min (Actual)'],
[lx, 'Max (Estimated)','Max (Actual)'],
]:
if float(line[a]) == 0.0:
lst.append(0)
else:
lst.append(abs(float(line[a])-float(line[e]))/float(line[a])*100)
plt.plot(la,label="average")
plt.plot(ld,label='stddev')
plt.plot(lc,label='count')
plt.plot(ls,label='sum')
plt.plot(lm,label='min')
plt.plot(lx,label='max')
plt.title(sys.argv[1])
plt.ylabel("% Deviation of Estimate vs Actual")
plt.xlabel("Epoch")
plt.ylim([0,200])
plt.legend()
plt.show()