-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_felli.py
146 lines (139 loc) · 4.71 KB
/
test_felli.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
from pmkoalas._logging import info, enable_logging
from felli.cocomot import guard_recall
from time import time
from os.path import join
from math import sqrt
AXS_FOLD = join(".", "axioms")
AX_3_FOLD = join(AXS_FOLD, "axiom 3")
AX_3_LOG = join(AX_3_FOLD, "log_1.xes")
AX_3_MODELS = [
join(AX_3_FOLD, f"ax3_model_{i}.pnml")
for i
in range(1,7)
]
AX_4_FOLD = join(AXS_FOLD, "axiom 4")
AX_4_LOG = join(AX_4_FOLD, "log_1.xes")
AX_4_MODEL = join(AX_4_FOLD, "ax4_model_1.pnml")
AX_6_FOLD = join(AXS_FOLD, "axiom 6")
AX_6_MODEL = join(AX_6_FOLD, "ax6_model_1.pnml")
AX_6_LOGS = [
join(AX_6_FOLD, f"log_{i}.xes")
for i
in range(1,4)
]
AX_7_FOLD = join(AXS_FOLD, "axiom 7")
AX_7_LOG = join(AX_7_FOLD, "log_1.xes")
AX_7_MODELS = [
join(AX_7_FOLD, f"ax7_model_{i}b.pnml")
for i
in range(1,6)
]
AX_8_FOLD = join(AXS_FOLD, "axiom 8")
AX_8_LOG = join(AX_8_FOLD, "log_1.xes")
AX_8_MODELS = [
join(AX_8_FOLD, f"ax8_model_{i}.pnml")
for i
in range(1,5)
]
AX_8_NEG_MODELS = [
join(AX_8_FOLD, f"ax8_model_{i}.pnml")
for i
in range(5,6)
]
AX_9_FOLD = join(AXS_FOLD, "axiom 9")
AX_9_MODEL = join(AX_9_FOLD, "ax9_model_1.pnml")
AX_9_LOGS = [
join(AX_9_FOLD, f"log_{i}.xes")
for i
in range(1,4)
]
AX_RERUNS = 11
OPTIMISED_RUN = True
@enable_logging
def axiom_3():
info("testing axiom 3 for proposal of guard-recall.")
log = AX_3_LOG
mean_computes = []
mean_runtimes = []
for test_no,model_file in enumerate(AX_3_MODELS):
results = []
ctimes = []
for run in range(1,AX_RERUNS):
info(f"computing run {run}...")
stime = time()
res = guard_recall(model_file, log)
ctimes.append(time() - stime)
results.append(res)
mean = sum(results) / len(results)
std = [ (res - mean) ** 2 for res in results ]
std = sum(std) / len(std)
std = sqrt(std)
info(f"results for model {test_no+1} of axiom 3 are :: {mean=} | {std=}.")
info(f"unique results observed :: {set(results)}.")
runtime = sum(ctimes)/ len (ctimes)
mean_runtimes.append(f"{runtime:.1f} seconds")
info(f"average compute time for runs :: {runtime:.1f} seconds.")
mean_computes.append((mean, std))
info(f"average runtimes for tests : {mean_runtimes}")
info("testing completed for axiom three, to adhere the following series" +
" must be strictly increasing from left to right")
info(f"outcome (mean,std) :: {mean_computes}")
@enable_logging
def axiom_4():
info("testing axiom 4 for proposal of guard-recall.")
results = []
log = AX_4_LOG
model = AX_4_MODEL
runtimes = []
for run in range(1,AX_RERUNS):
info(f"computing run {run}...")
stime = time()
res = guard_recall(model, log)
runtimes.append(time() - stime)
results.append(res)
mean = sum(results) / len(results)
std = [ (res - mean) ** 2 for res in results ]
std = sum(std) / len(std)
std = sqrt(std)
info(f"results of testing axiom 4 are :: {mean=} | {std=}.")
info(f"unique results observed :: {set(results)}.")
runtimes = sum(runtimes)/len(runtimes)
info(f"average compute time for runs :: {runtimes:.1f} seconds.")
info("testing completed for axiom four, to adhere the measure must " +
"return zero.")
info(f"outcomes :: {set(results)}")
@enable_logging
def axiom_6():
info("testing axiom 6 for proposal of guard-recall.")
model = AX_6_MODEL
mean_computes = []
mean_runtimes = []
for test_no, logfile in enumerate(AX_6_LOGS):
results = []
runtimes = []
for run in range(1,AX_RERUNS):
info(f"computing run {run}...")
stime = time()
res = guard_recall(model, logfile)
runtimes.append(time() - stime)
results.append(res)
mean = sum(results) / len(results)
std = [ (res - mean) ** 2 for res in results ]
std = sum(std) / len(std)
std = sqrt(std)
runtimes = sum(runtimes) / len(runtimes)
info(f"results for log {test_no+1} of axiom 6 are :: {mean=} | {std=}.")
info(f"unique results observed :: {set(results)}.")
info(f"mean compute time between runs :: {runtimes:.1f} seconds")
mean_runtimes.append(f"{runtimes:.1f}")
mean_computes.append((mean,std))
info(f"average runtimes for tests : {mean_runtimes}")
info("testing completed for axiom six, to adhere the following series" +
" must contain the same value for each step")
info(f"outcome (mean,std) :: {mean_computes}")
if __name__ == "__main__":
# guard-recall testing
axiom_3(debug=True)
axiom_4(debug=True)
axiom_6(debug=True)
# guard-precision testing