-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGCOMB_RESULTS_PARSE_sampling_rate.py
35 lines (30 loc) · 1.88 KB
/
GCOMB_RESULTS_PARSE_sampling_rate.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
#
dataset_list=["friendster/TV/"]##large_gowallah"]#,
for dataset in dataset_list:
for budget in [10, 20, 50, 100, 200]:
print(dataset)
out_gcomb_quality_time_sample=open('GCOMB_BUDGET_RESULTS/{}_budget{}'.format(dataset,
budget) + 'sampling_quality_time_budgets.txt',
'w')
for sampling_freq in [0.003]:#,0.009]:#[0.0005, 0.001, 0.003, 0.005, 0.007, 0.010, 0.05, 0.1]:
print(" SAMPLING ", sampling_freq)
print("BUDGET ", budget)
graph_path="./GraphSAGE-master/real_data/{}/test{}/large_graph".format(dataset,budget)
# rl_data = open(graph_path+'_reward_RL_budget_{}_nbs_{}'.format(budget, sampling_freq),'r').readlines()
#reward_gcomb= rl_data[0].replace('\n','')
#print(rl_data)
rl_time_file = open(graph_path +'-time_RL_budget{}_nbs_{}'.format(budget,sampling_freq),'r')
rl_time_taken = float(rl_time_file.read())
# rl_time_taken = float(rl_data[1].replace('\n','').split(':')[1])
#large_graph_num_k_150_time.txt_150_nbs_0.0005
rl_prep_file_path = graph_path+'_num_k_{}_time.txt_{}_nbs_{}'.format(budget,budget, sampling_freq)
print(rl_prep_file_path)
rl_prep_time= float(open(rl_prep_file_path,'r').readlines()[0].split('RL_PREP_TIME_')[1].replace('\n',''))
# print("rl time" ,rl_prep_time)
print("time",rl_prep_time,rl_time_taken)
total_gcomb_time = rl_prep_time+rl_time_taken
print("GCOMB","", total_gcomb_time)
out_gcomb_quality_time_sample.write(str(sampling_freq) +":" + str("")+":"+str(total_gcomb_time)+"\n")
# print(rl_data, greedy_data, sup_gs_data)
#
#+"\t"+str(total_gcomb_time)+"\t" +str(greedy_reward)+"\t"+ str(greedy_time) +"\t"+ str(sup_gs_reward)