-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaverage_error.py
65 lines (54 loc) · 3.4 KB
/
average_error.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
import csv
import numpy as np
def read_csv(filename):
data_list = []
with open(filename, 'r') as csvfile:
reader = csv.reader(csvfile)
headers = next(reader) # 跳过表头
for row in reader:
t = [int(i) for i in row]
data_list.append(sum(t)/len(t))
print(filename, sum(data_list)/len(data_list))
return data_list
sensor_BFS_sqrt = read_csv('./data_moreG_small/2error_sensor_BFS_sqrt.csv')
sensor_BFS_rand_BFS = read_csv('./data_moreG_small/2error_sensor_BFS_rand_BFS.csv')
sensor_BFS_stc = read_csv('./data_moreG_small/2error_sensor_BFS_stc.csv')
sensor_DFS_sqrt = read_csv('./data_moreG_small/2error_sensor_DFS_sqrt.csv')
sensor_DFS_rand_BFS = read_csv('./data_moreG_small/2error_sensor_DFS_rand_BFS.csv')
sensor_DFS_stc = read_csv('./data_moreG_small/2error_sensor_DFS_stc.csv')
print("----")
complete_nary_BFS_sqrt = read_csv('./data_moreG_small/2error_complete_nary_BFS_sqrt.csv')
complete_nary_BFS_rand_BFS = read_csv('./data_moreG_small/2error_complete_nary_BFS_rand_BFS.csv')
complete_nary_BFS_stc = read_csv('./data_moreG_small/2error_complete_nary_BFS_stc.csv')
complete_nary_DFS_sqrt = read_csv('./data_moreG_small/2error_complete_nary_DFS_sqrt.csv')
complete_nary_DFS_rand_BFS = read_csv('./data_moreG_small/2error_complete_nary_DFS_rand_BFS.csv')
complete_nary_DFS_stc = read_csv('./data_moreG_small/2error_complete_nary_DFS_stc.csv')
print("----")
regular_tree_BFS_sqrt = read_csv('./data_moreG_small/2error_regular_tree_BFS_sqrt.csv')
regular_tree_BFS_rand_BFS = read_csv('./data_moreG_small/2error_regular_tree_BFS_rand_BFS.csv')
regular_tree_BFS_stc = read_csv('./data_moreG_small/2error_regular_tree_BFS_stc.csv')
regular_tree_DFS_sqrt = read_csv('./data_moreG_small/2error_regular_tree_DFS_sqrt.csv')
regular_tree_DFS_rand_BFS = read_csv('./data_moreG_small/2error_regular_tree_DFS_rand_BFS.csv')
regular_tree_DFS_stc = read_csv('./data_moreG_small/2error_regular_tree_DFS_stc.csv')
print("----")
ER_random_BFS_sqrt = read_csv('./data_moreG_small/2error_ER_random_BFS_sqrt.csv')
ER_random_BFS_rand_BFS = read_csv('./data_moreG_small/2error_ER_random_BFS_rand_BFS.csv')
ER_random_BFS_stc = read_csv('./data_moreG_small/2error_ER_random_BFS_stc.csv')
ER_random_DFS_sqrt = read_csv('./data_moreG_small/2error_ER_random_DFS_sqrt.csv')
ER_random_DFS_rand_BFS = read_csv('./data_moreG_small/2error_ER_random_DFS_rand_BFS.csv')
ER_random_DFS_stc = read_csv('./data_moreG_small/2error_ER_random_DFS_stc.csv')
print("----")
real_world_BFS_sqrt = read_csv('./data_moreG_small/2error_real_world_BFS_sqrt.csv')
real_world_BFS_rand_BFS = read_csv('./data_moreG_small/2error_real_world_BFS_rand_BFS.csv')
real_world_BFS_stc = read_csv('./data_moreG_small/2error_real_world_BFS_stc.csv')
real_world_DFS_sqrt = read_csv('./data_moreG_small/2error_real_world_DFS_sqrt.csv')
real_world_DFS_rand_BFS = read_csv('./data_moreG_small/2error_real_world_DFS_rand_BFS.csv')
real_world_DFS_stc = read_csv('./data_moreG_small/2error_real_world_DFS_stc.csv')
print("----")
SBM_BFS_sqrt = read_csv('./data_moreG_small/2error_SBM_BFS_sqrt.csv')
SBM_BFS_rand_BFS = read_csv('./data_moreG_small/2error_SBM_BFS_rand_BFS.csv')
SBM_BFS_stc = read_csv('./data_moreG_small/2error_SBM_BFS_stc.csv')
SBM_DFS_sqrt = read_csv('./data_moreG_small/2error_SBM_DFS_sqrt.csv')
SBM_DFS_rand_BFS = read_csv('./data_moreG_small/2error_SBM_DFS_rand_BFS.csv')
SBM_DFS_stc = read_csv('./data_moreG_small/2error_SBM_DFS_stc.csv')
print("----")