@@ -3,30 +3,40 @@ include("../Experiments.jl")
3
3
# datasets = [human, aids]
4
4
datasets = [human, aids, lubm80, yeast, dblp, youtube, eu2005, patents]
5
5
# datasets = [human, aids, yeast, dblp, youtube, eu2005, patents]
6
- datasets = [yeast]
6
+ # datasets = [human, aids, yeast, dblp, youtube, ]
7
7
queries = load_querysets (datasets)
8
8
num_queries = Dict (string (dataset)=> length (queries[dataset]) for dataset in datasets)
9
9
10
10
methods, comparison_results = comparison_dataset ()
11
11
12
12
failure_counts = Dict ()
13
13
failure_probabilities = Dict ()
14
+ missing_counts = Dict ()
15
+ zero_counts = Dict ()
14
16
for method in methods
15
17
failure_counts[method] = counter (String)
18
+ missing_counts[method] = counter (String)
19
+ zero_counts[method] = counter (String)
16
20
failure_probabilities[method] = Dict ()
17
21
for dataset in datasets
18
22
string_dataset = string (dataset)
19
- for query in queries[dataset]
20
- qid = get_query_id (string_dataset, query. query_path)
21
- comp_key = (string_dataset, method, qid)
22
- if ! haskey (comparison_results, comp_key)
23
- inc! (failure_counts[method], string_dataset)
24
- elseif comparison_results[comp_key]. Estimate == 0
25
- inc! (failure_counts[method], string_dataset)
26
- elseif comparison_results[comp_key]. Estimate == Inf
27
- inc! (failure_counts[method], string_dataset)
28
- elseif comparison_results[comp_key]. Estimate == NaN
29
- inc! (failure_counts[method], string_dataset)
23
+ if method == " cset"
24
+ failure_counts[method][string_dataset] = 0
25
+ else
26
+ for query in queries[dataset]
27
+ qid = get_query_id (string_dataset, query. query_path)
28
+ comp_key = (string_dataset, method, qid)
29
+ if ! haskey (comparison_results, comp_key)
30
+ inc! (failure_counts[method], string_dataset)
31
+ inc! (missing_counts[method], string_dataset)
32
+ elseif comparison_results[comp_key]. Estimate == 0
33
+ inc! (failure_counts[method], string_dataset)
34
+ inc! (zero_counts[method], string_dataset)
35
+ elseif comparison_results[comp_key]. Estimate == Inf
36
+ inc! (failure_counts[method], string_dataset)
37
+ elseif comparison_results[comp_key]. Estimate == NaN
38
+ inc! (failure_counts[method], string_dataset)
39
+ end
30
40
end
31
41
end
32
42
failure_probabilities[method][string_dataset] = failure_counts[method][string_dataset] / num_queries[string_dataset]
35
45
36
46
failure_counts[" BSK" ] = counter (String)
37
47
failure_counts[" BSK++" ] = counter (String)
38
- failure_counts[" AvgMix64 " ] = counter (String)
48
+ failure_counts[" AvgMix32 " ] = counter (String)
39
49
failure_probabilities[" BSK" ] = Dict ()
40
50
failure_probabilities[" BSK++" ] = Dict ()
41
- failure_probabilities[" AvgMix64 " ] = Dict ()
51
+ failure_probabilities[" AvgMix32 " ] = Dict ()
42
52
for dataset in datasets
43
53
string_dataset = string (dataset)
44
54
bsk_params = ExperimentParams (deg_stats_type= MaxDegStats,
@@ -83,30 +93,31 @@ for dataset in datasets
83
93
failure_probabilities[" BSK++" ][string_dataset] = failure_counts[" BSK++" ][string_dataset] / num_queries[string_dataset]
84
94
85
95
86
- mix_scheme = [(QuasiStable, 32 ), (NeighborNodeLabels, 16 ), (NodeLabels, 16 )]
96
+ mix_scheme = [(Degree, 8 ), ( QuasiStable, 8 ), (NeighborNodeLabels, 8 ), (NodeLabels, 8 )]
87
97
avg_params = ExperimentParams (dataset= dataset,
88
- n_replications = 2 ,
89
- partitioning_scheme = mix_scheme )
98
+ partitioning_scheme = mix_scheme ,
99
+ inference_max_paths = 500 )
90
100
# build_experiments([avg_params])
91
101
# run_estimation_experiments([avg_params]; timeout=TIMEOUT_SEC)
92
102
avg_filename = params_to_results_filename (avg_params)
93
103
avg_path = " Experiments/Results/Estimation_" * avg_filename
94
104
avg_df = CSV. read (avg_path, DataFrame; normalizenames= true )
95
105
for i in 1 : nrow (avg_df)
96
106
if avg_df[i, :Failure ]
97
- inc! (failure_counts[" AvgMix64 " ], string_dataset)
107
+ inc! (failure_counts[" AvgMix32 " ], string_dataset)
98
108
end
99
109
end
100
- failure_probabilities[" AvgMix64 " ][string_dataset] = failure_counts[" AvgMix64 " ][string_dataset] / num_queries[string_dataset]
110
+ failure_probabilities[" AvgMix32 " ][string_dataset] = failure_counts[" AvgMix32 " ][string_dataset] / num_queries[string_dataset]
101
111
end
102
112
103
- estimators = [" cs" , " wj" , " jsub" , " impr" , " cset" , " alley" , " BSK " , " BSK++" , " sumrdf" , " AvgMix64 " ]
113
+ estimators = [" cs" , " wj" , " jsub" , " impr" , " cset" , " alley" , " alleyTPI " , " BSK++" , " sumrdf" , " AvgMix32 " ]
104
114
105
115
global latex_table = """
106
116
\\ begin{table*}[]
117
+ \\ caption{Estimator Failure Rates}
107
118
\\ begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|}
108
119
\\ hline
109
- \\ textbf{Dataset\\ textbackslash{}Method} """
120
+ \\ textbf{Dataset\\ textbackslash{}Method} \n """
110
121
for estimator in estimators
111
122
global latex_table *= """ & \\ textbf{""" * string (estimator) * """ } """
112
123
end
@@ -115,13 +126,14 @@ global latex_table *= """\\\\
115
126
for dataset in datasets
116
127
global latex_table *= """ \\ textbf{""" * string (dataset) * """ } """
117
128
for estimator in estimators
118
- global latex_table *= " & " * @sprintf (" %.2f" , failure_probabilities[estimator][string (dataset)])
129
+ failure_prob = failure_probabilities[estimator][string (dataset)]
130
+ red_percent = Int (floor (100 * failure_prob^ .5 ))
131
+ global latex_table *= " & " * " \\ cellcolor{red!" * string (red_percent) * " !green!50}" * @sprintf (" %.2f" , failure_prob)
119
132
end
120
- global latex_table *= """ \\\\ \\ hline """
133
+ global latex_table *= """ \\\\ \\ hline \n """
121
134
end
122
135
global latex_table *= """
123
136
\\ end{tabular}
124
- \\ caption{Estimator Failure Rates}
125
137
\\ label{tbl:estimator-failure}
126
138
\\ end{table*}
127
139
"""
0 commit comments