pm4py.vis.save_vis_network_analysis#

pm4py.vis.save_vis_network_analysis(network_analysis: Dict[Tuple[str, str], Dict[str, Any]], file_path: str, variant: str = 'frequency', activity_threshold: int = 1, edge_threshold: int = 1, bgcolor: str = 'white', **kwargs)[source]#

Saves the visualization of the network analysis

Parameters:
  • network_analysis – Network analysis

  • file_path (str) – Target path of the visualization

  • variant (str) – Variant of the visualization: - frequency (if the discovered network analysis contains the frequency of the interactions) - performance (if the discovered network analysis contains the performance of the interactions)

  • activity_threshold (int) – The minimum number of occurrences for an activity to be included (default: 1)

  • edge_threshold (int) – The minimum number of occurrences for an edge to be included (default: 1)

  • bgcolor (str) – Background color of the visualization (default: white)

import pm4py

net_ana = pm4py.discover_network_analysis(dataframe, out_column='case:concept:name', in_column='case:concept:name', node_column_source='org:resource', node_column_target='org:resource', edge_column='concept:name')
pm4py.save_vis_network_analysis(net_ana, 'net_ana.png')