pm4py.discovery.discover_petri_net_heuristics#
- pm4py.discovery.discover_petri_net_heuristics(log: EventLog | DataFrame, dependency_threshold: float = 0.5, and_threshold: float = 0.65, loop_two_threshold: float = 0.5, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Tuple[PetriNet, Marking, Marking] [source]#
Discovers a Petri net using the Heuristics Miner.
Heuristics Miner operates on the Directly-Follows Graph, handling noise and identifying common constructs such as dependencies between activities and parallelism. The output is a Heuristics Net, which can then be converted into a Petri net.
- Parameters:
log – Event log or Pandas DataFrame.
dependency_threshold (
float
) – Dependency threshold (default: 0.5).and_threshold (
float
) – AND threshold for parallelism (default: 0.65).loop_two_threshold (
float
) – Loop two threshold (default: 0.5).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 containing the Petri net, initial marking, and final marking.
- Return type:
Tuple[PetriNet, Marking, Marking]
import pm4py net, im, fm = pm4py.discover_petri_net_heuristics( dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp' )