pm4py.discovery.discover_dfg#
- pm4py.discovery.discover_dfg(log: EventLog | DataFrame, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Tuple[dict, dict, dict] [source]#
Discovers a Directly-Follows Graph (DFG) from a log.
This method returns a tuple containing: - A dictionary with pairs of directly-following activities as keys and the frequency of the relationship as values. - A dictionary of start activities with their respective frequencies. - A dictionary of end activities with their respective frequencies.
- 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 tuple of three dictionaries: (dfg, start_activities, end_activities).
- Return type:
Tuple[dict, dict, dict]
import pm4py dfg, start_activities, end_activities = pm4py.discover_dfg( dataframe, case_id_key='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp' )