-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
91 lines (81 loc) · 7.03 KB
/
test.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import experiments
from common.fig import plot_dual_distribution, plot_single_distribution
if __name__ == '__main__':
# effect of data size on Mono-RkNN
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_MonoRkNN(k=10,
distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-data-size-on-MonoRkNN-time-cost(k=10,Synthetic)')
plot_dual_distribution(io_cost, 'Effect-of-data-size-on-MonoRkNN-io-cost(k=10,Synthetic)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_MonoRkNN(k=10,
distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-data-size-on-MonoRkNN-time-cost(k=10,Real)')
plot_single_distribution(io_cost, 'Effect-of-data-size-on-MonoRkNN-io-cost(k=10,Real)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_MonoRkNN(k=1000,
distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-data-size-on-MonoRkNN-time-cost(k=1000,Synthetic)')
plot_dual_distribution(io_cost, 'Effect-of-data-size-on-MonoRkNN-io-cost(k=1000,Synthetic)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_MonoRkNN(k=1000,
distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-data-size-on-MonoRkNN-time-cost(k=1000,Real)')
plot_single_distribution(io_cost, 'Effect-of-data-size-on-MonoRkNN-io-cost(k=1000,Real)')
# effect of data size on Bi-RkNN
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_BiRkNN(k=10,
distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-data-size-on-BiRkNN-time-cost(k=10,Synthetic)')
plot_dual_distribution(io_cost, 'Effect-of-data-size-on-BiRkNN-io-cost(k=10,Synthetic)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_BiRkNN(k=10,
distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-data-size-on-BiRkNN-time-cost(k=10,Real)')
plot_single_distribution(io_cost, 'Effect-of-data-size-on-BiRkNN-io-cost(k=10,Reals)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_BiRkNN(k=1000,
distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-data-size-on-BiRkNN-time-cost(k=1000,Synthetic)')
plot_dual_distribution(io_cost, 'Effect-of-data-size-on-BiRkNN-io-cost(k=1000,Synthetic)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_size_on_BiRkNN(k=1000,
distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-data-size-on-BiRkNN-time-cost(k=1000,Real)')
plot_single_distribution(io_cost, 'Effect-of-data-size-on-BiRkNN-io-cost(k=1000,Reals)')
# effect of k on Mono-RkNN
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_k_on_MonoRkNN(distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-k-on-MonoRkNN-time-cost(Synthetic)', scale='log')
plot_dual_distribution(io_cost, 'Effect-of-k-on-MonoRkNN-io-cost(Synthetic)', scale='log')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_k_on_MonoRkNN(distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-k-on-MonoRkNN-time-cost(Real)', scale='log')
plot_single_distribution(io_cost, 'Effect-of-k-on-MonoRkNN-io-cost(Real)', scale='log')
# effect of k on Bi-RkNN
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_k_on_BiRkNN(distribution='Synthetic')
plot_dual_distribution(time_cost, 'Effect-of-k-on-BiRkNN-time-cost(Synthetic)', scale='log')
plot_dual_distribution(io_cost, 'Effect-of-k-on-BiRkNN-io-cost(Synthetic)', scale='log')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_k_on_BiRkNN(distribution='Real')
plot_single_distribution(time_cost, 'Effect-of-k-on-BiRkNN-time-cost(Real)', scale='log')
plot_single_distribution(io_cost, 'Effect-of-k-on-BiRkNN-io-cost(Real)', scale='log')
# effect of number of users relative to number of facilities
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_user_num_relative_to_facility_num(k=10)
plot_dual_distribution(time_cost, 'Effect-of-user-relative-to-facility-on-BiRkNN-time-cost(k=10)')
plot_dual_distribution(io_cost, 'Effect-of-user-relative-to-facility-on-BiRkNN-io-cost(k=10)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_user_num_relative_to_facility_num(k=1000)
plot_dual_distribution(time_cost, 'Effect-of-user-relative-to-facility-on-BiRkNN-time-cost(k=1000)')
plot_dual_distribution(io_cost, 'Effect-of-user-relative-to-facility-on-BiRkNN-io-cost(k=1000)')
# effect of data distribution
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_distribution(k=10)
plot_single_distribution(time_cost, 'Effect-of-distribution-on-BiRkNN-time-cost(k=10)')
plot_single_distribution(io_cost, 'Effect-of-distribution-on-BiRkNN-io-cost(k=10)')
time_cost, io_cost = experiments.BenchmarkExperiments.evaluate_effect_of_data_distribution(k=1000)
plot_single_distribution(time_cost, 'Effect-of-distribution-on-BiRkNN-time-cost(k=1000)')
plot_single_distribution(io_cost, 'Effect-of-distribution-on-BiRkNN-io-cost(k=1000)')
# effect of k on RkNN for restaurant
time_cost, io_cost = experiments.CaseStudyExperiments.evaluate_RkNN_for_restaurant()
plot_single_distribution(time_cost, 'Time-cost-of-RkNN-for-restaurant')
plot_single_distribution(io_cost, 'IO-cost-of-RkNN-for-restaurant')
# effect of k on RkNN for mall
time_cost, io_cost = experiments.CaseStudyExperiments.evaluate_RkNN_for_mall()
plot_single_distribution(time_cost, 'Time-cost-of-RkNN-for-mall')
plot_single_distribution(io_cost, 'IO-cost-of-RkNN-for-mall')
# effect of k on RkNN for hospital
time_cost, io_cost = experiments.CaseStudyExperiments.evaluate_RkNN_for_hospital()
plot_single_distribution(time_cost, 'Time-cost-of-RkNN-for-hospital')
plot_single_distribution(io_cost, 'IO-cost-of-RkNN-for-hospital')
# effect of k on RkNN for school
time_cost, io_cost = experiments.CaseStudyExperiments.evaluate_RkNN_for_school()
plot_single_distribution(time_cost, 'Time-cost-of-RkNN-for-school')
plot_single_distribution(io_cost, 'IO-cost-of-RkNN-for-school')