baakaani commited on
Commit
8036cbd
·
1 Parent(s): a2c8d13

changes in benchmark.py and experiment_test.json to include output path and specify event log names

Browse files
config_files/algorithm/experiment_test.json CHANGED
@@ -46,6 +46,7 @@
46
  "pipeline_step": "benchmark_test",
47
  "benchmark_test": "discovery",
48
  "input_path":"data/test_2",
 
49
  "miners" : ["inductive", "heuristics", "imf", "ilp", "sm"]
50
  }
51
  ]
 
46
  "pipeline_step": "benchmark_test",
47
  "benchmark_test": "discovery",
48
  "input_path":"data/test_2",
49
+ "output_path":"output",
50
  "miners" : ["inductive", "heuristics", "imf", "ilp", "sm"]
51
  }
52
  ]
tag/benchmark.py CHANGED
@@ -15,6 +15,7 @@ from pm4py.algo.evaluation.generalization import algorithm as generalization_eva
15
  from pm4py.algo.evaluation.simplicity import algorithm as simplicity_evaluator
16
  from pm4py.objects.bpmn.obj import BPMN
17
  from pm4py.objects.log.importer.xes import importer as xes_importer
 
18
  from tag.utils.io_helpers import dump_features_json
19
  from tqdm import tqdm
20
  from utils.param_keys import INPUT_PATH, OUTPUT_PATH
@@ -44,11 +45,10 @@ class BenchmarkTest:
44
  if True:
45
  num_cores = multiprocessing.cpu_count() if len(
46
  event_logs) >= multiprocessing.cpu_count() else len(event_logs)
47
- #self.benchmark_wrapper(event_logs[0], miners=self.params[MINERS])# TESTING
48
  with multiprocessing.Pool(num_cores) as p:
49
  print(f"INFO: Benchmark starting at {start.strftime('%H:%M:%S')} using {num_cores} cores for {len(event_logs)} files...")
50
- p.map(partial(self.benchmark_wrapper, miners = self.params[MINERS])
51
- , event_logs)
52
 
53
  # Aggregates metafeatures in saved Jsons into dataframe
54
  self.root_path = self.params[INPUT_PATH]
@@ -88,7 +88,11 @@ class BenchmarkTest:
88
 
89
  benchmark_results = pd.DataFrame()
90
  # TODO: Use iteratevely generated name for log name in dataframe for passed unnamed logs instead of whole log. E.g. gen_el_1, gen_el_2,...
91
- results = {'log': event_log.replace(".xes", "")}
 
 
 
 
92
  for miner in miners:
93
  miner_cols = [f"fitness_{miner}", f"precision_{miner}", f"fscore_{miner}", f"size_{miner}", f"cfc_{miner}", f"pnsize_{miner}"]# f"generalization_{miner}",f"simplicity_{miner}"]
94
  start_miner = dt.now()
 
15
  from pm4py.algo.evaluation.simplicity import algorithm as simplicity_evaluator
16
  from pm4py.objects.bpmn.obj import BPMN
17
  from pm4py.objects.log.importer.xes import importer as xes_importer
18
+ from pm4py.objects.log.obj import EventLog
19
  from tag.utils.io_helpers import dump_features_json
20
  from tqdm import tqdm
21
  from utils.param_keys import INPUT_PATH, OUTPUT_PATH
 
45
  if True:
46
  num_cores = multiprocessing.cpu_count() if len(
47
  event_logs) >= multiprocessing.cpu_count() else len(event_logs)
48
+ # self.benchmark_wrapper(event_logs[0], miners=self.params[MINERS])# TESTING
49
  with multiprocessing.Pool(num_cores) as p:
50
  print(f"INFO: Benchmark starting at {start.strftime('%H:%M:%S')} using {num_cores} cores for {len(event_logs)} files...")
51
+ p.map(partial(self.benchmark_wrapper, miners = self.params[MINERS]), event_logs)
 
52
 
53
  # Aggregates metafeatures in saved Jsons into dataframe
54
  self.root_path = self.params[INPUT_PATH]
 
88
 
89
  benchmark_results = pd.DataFrame()
90
  # TODO: Use iteratevely generated name for log name in dataframe for passed unnamed logs instead of whole log. E.g. gen_el_1, gen_el_2,...
91
+ if isinstance(event_log, str):
92
+ results = {'log': event_log.replace(".xes", "")}
93
+ else:
94
+ results = {"log": event_log}
95
+
96
  for miner in miners:
97
  miner_cols = [f"fitness_{miner}", f"precision_{miner}", f"fscore_{miner}", f"size_{miner}", f"cfc_{miner}", f"pnsize_{miner}"]# f"generalization_{miner}",f"simplicity_{miner}"]
98
  start_miner = dt.now()