Spaces:
Runtime error
Runtime error
Download pm4py/examples/cost_based_dfg.py from linpershey/process_mining: direct link, hf CLI and curl.
- Browser
- Download file 742 Bytes
-
https://huggingface.co/spaces/linpershey/process_mining/resolve/main/pm4py/examples/cost_based_dfg.py
- Command line
-
hf download hf://spaces/linpershey/process_mining/pm4py/examples/cost_based_dfg.py
-
curl -L -o cost_based_dfg.py https://huggingface.co/spaces/linpershey/process_mining/resolve/main/pm4py/examples/cost_based_dfg.py
742 Bytes
| import pm4py | |
| import os | |
| from pm4py.algo.discovery.dfg.adapters.pandas import df_statistics | |
| from examples import examples_conf | |
| import importlib.util | |
| def execute_script(): | |
| log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "roadtraffic100traces.xes"), return_legacy_log_object=False) | |
| cost_based_dfg = df_statistics.get_dfg_graph(log, measure="cost", cost_attribute="amount") | |
| if importlib.util.find_spec("grapviz"): | |
| from pm4py.visualization.dfg import visualizer as dfg_visualizer | |
| gviz = dfg_visualizer.apply(cost_based_dfg, variant=dfg_visualizer.Variants.COST, parameters={"format": examples_conf.TARGET_IMG_FORMAT}) | |
| dfg_visualizer.view(gviz) | |
| if __name__ == "__main__": | |
| execute_script() | |