Spaces:
Running
Running
Andrea Maldonado
commited on
Commit
·
8dcad92
1
Parent(s):
1d9ed09
Restores run file
Browse files- gedi/__init__.py +1 -6
- gedi/run.py +53 -0
gedi/__init__.py
CHANGED
@@ -1,8 +1,3 @@
|
|
1 |
-
from .generator import GenerateEventLogs
|
2 |
-
from .features import EventLogFeatures
|
3 |
-
from .augmentation import InstanceAugmentator
|
4 |
-
from .benchmark import BenchmarkTest
|
5 |
-
from .plotter import BenchmarkPlotter, FeaturesPlotter, AugmentationPlotter, GenerationPlotter
|
6 |
from .run import gedi
|
7 |
|
8 |
-
__all__=[ 'gedi'
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from .run import gedi
|
2 |
|
3 |
+
__all__=[ 'gedi']
|
gedi/run.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import config
|
2 |
+
import pandas as pd
|
3 |
+
from datetime import datetime as dt
|
4 |
+
from gedi.generator import GenerateEventLogs
|
5 |
+
from gedi.features import EventLogFeatures
|
6 |
+
from gedi.augmentation import InstanceAugmentator
|
7 |
+
from gedi.benchmark import BenchmarkTest
|
8 |
+
from gedi.plotter import BenchmarkPlotter, FeaturesPlotter, AugmentationPlotter, GenerationPlotter
|
9 |
+
from utils.default_argparse import ArgParser
|
10 |
+
from utils.param_keys import *
|
11 |
+
|
12 |
+
def run(kwargs:dict, model_params_list: list, filename_list:list):
|
13 |
+
"""
|
14 |
+
This function chooses the running option for the program.
|
15 |
+
@param kwargs: dict
|
16 |
+
contains the running parameters and the event-log file information
|
17 |
+
@param model_params_list: list
|
18 |
+
contains a list of model parameters, which are used to analyse this different models.
|
19 |
+
@param filename_list: list
|
20 |
+
contains the list of the filenames to load multiple event-logs
|
21 |
+
@return:
|
22 |
+
"""
|
23 |
+
params = kwargs[PARAMS]
|
24 |
+
ft = EventLogFeatures(None)
|
25 |
+
augmented_ft = InstanceAugmentator()
|
26 |
+
gen = pd.DataFrame(columns=['log'])
|
27 |
+
|
28 |
+
for model_params in model_params_list:
|
29 |
+
if model_params.get(PIPELINE_STEP) == 'instance_augmentation':
|
30 |
+
augmented_ft = InstanceAugmentator(aug_params=model_params, samples=ft.feat)
|
31 |
+
AugmentationPlotter(augmented_ft, model_params)
|
32 |
+
elif model_params.get(PIPELINE_STEP) == 'event_logs_generation':
|
33 |
+
gen = pd.DataFrame(GenerateEventLogs(model_params).log_config)
|
34 |
+
#gen = pd.read_csv("output/features/generated/grid_2objectives_enseef_enve/2_enseef_enve_feat.csv")
|
35 |
+
#GenerationPlotter(gen, model_params, output_path="output/plots")
|
36 |
+
elif model_params.get(PIPELINE_STEP) == 'benchmark_test':
|
37 |
+
benchmark = BenchmarkTest(model_params, event_logs=gen['log'])
|
38 |
+
# BenchmarkPlotter(benchmark.features, output_path="output/plots")
|
39 |
+
elif model_params.get(PIPELINE_STEP) == 'feature_extraction':
|
40 |
+
ft = EventLogFeatures(**kwargs, logs=gen['log'], ft_params=model_params)
|
41 |
+
FeaturesPlotter(ft.feat, model_params)
|
42 |
+
elif model_params.get(PIPELINE_STEP) == "evaluation_plotter":
|
43 |
+
GenerationPlotter(gen, model_params, output_path=model_params['output_path'], input_path=model_params['input_path'])
|
44 |
+
|
45 |
+
def gedi(config_path):
|
46 |
+
"""
|
47 |
+
This function runs the GEDI pipeline.
|
48 |
+
@param config_path: str
|
49 |
+
contains the path to the config file
|
50 |
+
@return:
|
51 |
+
"""
|
52 |
+
model_params_list = config.get_model_params_list(config_path)
|
53 |
+
run({'params':""}, model_params_list, [])
|