Skip to content

Commit b1f67b9

Browse files
committed
Final performance tests
1 parent b39a9b7 commit b1f67b9

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

core/tests/test_perf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ def calculate_helper_hyperopt(self, job):
3535

3636
def test_class_randomForest(self):
3737
job = self.get_job()
38-
job['label'] = LabelContainer(NEXT_ACTIVITY)
3938
add_default_config(job)
4039
self.calculate_helper(job)
4140

42-
def test_ne_randomForest(self):
41+
def ne_randomForest(self):
4342
job = self.get_job()
43+
job['label'] = LabelContainer(NEXT_ACTIVITY)
4444
add_default_config(job)
4545
self.calculate_helper(job)
4646

@@ -56,7 +56,7 @@ def test_class_decision(self):
5656
add_default_config(job)
5757
self.calculate_helper(job)
5858

59-
def test_reg_hyperopt(self):
59+
def test_class_hyperopt(self):
6060
job = self.get_job()
6161
job['label'] = LabelContainer(NEXT_ACTIVITY)
6262
job['hyperopt'] = {'use_hyperopt': True, 'max_evals': 10, 'performance_metric': 'f1score'}
@@ -72,7 +72,7 @@ def get_job(self):
7272
json["split"] = split_single()
7373
json["split"]["original_log_path"] = "log_cache/BPI Challenge 2017.xes.gz"
7474
json["method"] = "randomForest"
75-
json["encoding"] = "boolean"
75+
json["encoding"] = EncodingContainer(BOOLEAN, prefix_length=20)
7676
json["prefix_length"] = 20
7777
json["type"] = "regression"
7878
json["padding"] = 'no_padding'
@@ -89,18 +89,18 @@ def calculate_helper_hyperopt(self, job):
8989
calculate_hyperopt(job)
9090
print("Total for %s %s seconds" % (job['method'], time.time() - start_time))
9191

92-
def test_class_randomForest(self):
92+
def test_reg_randomForest(self):
9393
job = self.get_job()
9494
add_default_config(job)
9595
self.calculate_helper(job)
9696

97-
def test_class_linear(self):
97+
def test_reg_linear(self):
9898
job = self.get_job()
9999
job['method'] = 'linear'
100100
add_default_config(job)
101101
self.calculate_helper(job)
102102

103-
def test_class_lasso(self):
103+
def test_reg_lasso(self):
104104
job = self.get_job()
105105
job['method'] = 'lasso'
106106
add_default_config(job)

encoders/tests/test_performance.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,30 @@ def test_performance(self):
6161
class TestTraceLengthTime(TestCase):
6262
def setUp(self):
6363
self.label = LabelContainer(NO_LABEL)
64+
start_time = time.time()
65+
self.log1 = get_logs("log_cache/Sepsis Cases - Event Log.xes.gz")[0]
66+
print("Total for %s %s seconds" % ("sepsis", time.time() - start_time))
67+
start_time = time.time()
68+
self.log2 = get_logs("log_cache/financial_log.xes.gz")[0]
69+
print("Total for %s %s seconds" % ("financial", time.time() - start_time))
70+
start_time = time.time()
71+
self.log3 = get_logs("log_cache/BPI Challenge 2017.xes.gz")[0]
72+
print("Total for %s %s seconds" % ("2017", time.time() - start_time))
6473

65-
def do_test(self, encoding, log_path):
74+
def do_test(self, encoding, log):
6675
start_time = time.time()
67-
log = get_logs(log_path)[0]
76+
# log = get_logs(log_path)[0]
6877
add_col = get_global_event_attributes(log)
6978
event_names = unique_events(log)
7079
encoding = EncodingContainer(encoding, prefix_length=20, padding=ZERO_PADDING)
7180
log = encode_label_log(log, encoding, REGRESSION, self.label, event_names=event_names,
7281
additional_columns=add_col)
7382
print(log.shape)
74-
print("Total %s for %s %s seconds" % (log_path, encoding.method, time.time() - start_time))
83+
print("Total for %s %s seconds" % (encoding.method, time.time() - start_time))
7584

7685
def test_performance(self):
7786
encs = [SIMPLE_INDEX, BOOLEAN, FREQUENCY, COMPLEX, LAST_PAYLOAD]
78-
logs = ["log_cache/Sepsis Cases - Event Log.xes.gz", "log_cache/financial_log.xes.gz",
79-
"log_cache/BPI Challenge 2017.xes.gz"]
87+
logs = [self.log3]
8088
for l in logs:
8189
for e in encs:
8290
self.do_test(e, l)

0 commit comments

Comments
 (0)