-
Notifications
You must be signed in to change notification settings - Fork 1
/
count_nodes.py
30 lines (21 loc) · 973 Bytes
/
count_nodes.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
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import warnings
warnings.filterwarnings("ignore")
pd.options.display.float_format = '{:.4f}'.format
# mc2='/home/nico/codes/benchmarks/MC-2/'
mc3='/home/nico/codes/benchmarks/MC-3/'
csv=['benchmark_Model_MC-3_10%.csv','benchmark_Model_MC-3_30%.csv','benchmark_Model_MC-3_50%.csv','benchmark_Model_MC-3_70%.csv','benchmark_Model_MC-3_90%.csv']
promedios=[]
for i in csv:
Criteria = pd.read_csv(mc3+i)
Criteria['File'] = Criteria['File'].str.replace('for_dataset/', '').str.replace('.bch', '').str.replace('_', '\\_')
Criteria_grouped =Criteria.groupby('File')
mean_values = Criteria_grouped['Nodes','ANN time'].mean()
mean_values['division'] = mean_values['ANN time'] / mean_values['Nodes']
mean_division = mean_values['division'].mean()
rounded_mean_division = round(mean_division, 5)
promedios.append(rounded_mean_division)
for i in promedios:
print(i)