forked from zyrrron/Vespa-Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
result_statistics.py
38 lines (36 loc) · 1.09 KB
/
result_statistics.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
import os
from statistics import mean
import numpy as np
import pandas as pd
from csv import reader
pp = []
path = f"TestCaseFiles/csv_2_20_200_combined/resulttable.csv"
csv_file = open(path, 'r')
df = reader(csv_file, delimiter='\t')
f = open("TestCaseFiles/csv_2_20_200_combined/resultinfo.csv", "a")
name = ["true positive", "false negative", "false positive", "true negative", "accuracy", "max time", "mean time", "avg time"]
flag = 0
result_list = []
sr_list = []
list_element = []
for c in df:
if len(c) < 2:
if len(list_element) != 0:
result_list.append(list_element)
print(list_element[4])
for ee in range(len(list_element[4])):
f.write(f"{1-list_element[4][ee]};")
f.write('\n')
list_element = []
flag = 1
continue
# index = name.index(c[0])
c_new = list(map(float, c[1:]))
list_element.append(c_new)
# reverse the matrix of list_element[4]
# sr_list = pd.DataFrame(sr_list)
# sr_list_r = sr_list.transpose()
# ee = sr_list_r.values.tolist()
# for e in ee:
# print(e)
f.close()