forked from myay/TREAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult_summarizer.py
43 lines (25 loc) · 952 Bytes
/
result_summarizer.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
import os
def main():
src_path = "./results/complete_trees/normal_split/"
#des_path = "./results/clean/trials/"
out = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
counter = 0
for filename in os.listdir(src_path):
if(filename.find("pkl") == -1):
counter = counter + 1
#print(filename)
with open(src_path + filename, 'r') as f:
#with open(des_path + filename, 'w+') as w:
for idx, line in enumerate(f.readlines()):
print(line)
if(idx != 0):
out[idx-1] += float(line.split(",")[1][:-2])
#else:
#out = line.split()
#out = line.split(" ")[1] + line.split(" ")[3]
#w.write(out + "\n")
for idx, sum in enumerate(out):
out[idx] = sum / counter
print(out)
if __name__ == '__main__':
main()