pm4py.discovery.discover_eventually_follows_graph#

pm4py.discovery.discover_eventually_follows_graph(log: EventLog | DataFrame, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Dict[Tuple[str, str], int][source]#

Generates the Eventually-Follows Graph from a log.

The Eventually-Follows Graph is a dictionary that maps each pair of activities to the number of times one activity eventually follows the other in the log.

Parameters:
  • log – Event log or Pandas DataFrame.

  • activity_key (str) – Attribute to be used for the activity (default: “concept:name”).

  • timestamp_key (str) – Attribute to be used for the timestamp (default: “time:timestamp”).

  • case_id_key (str) – Attribute to be used as case identifier (default: “case:concept:name”).

Returns:

A dictionary mapping each pair of activities to the count of their eventually-follows relationship.

Return type:

Dict[Tuple[str, str], int]

import pm4py

efg = pm4py.discover_eventually_follows_graph(
    dataframe,
    activity_key='concept:name',
    case_id_key='case:concept:name',
    timestamp_key='time:timestamp'
)