pm4py.algo.discovery.heuristics.variants.classic module#

class pm4py.algo.discovery.heuristics.variants.classic.Parameters(*values)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
DEPENDENCY_THRESH = 'dependency_thresh'#
AND_MEASURE_THRESH = 'and_measure_thresh'#
MIN_ACT_COUNT = 'min_act_count'#
MIN_DFG_OCCURRENCES = 'min_dfg_occurrences'#
DFG_PRE_CLEANING_NOISE_THRESH = 'dfg_pre_cleaning_noise_thresh'#
LOOP_LENGTH_TWO_THRESH = 'loop_length_two_thresh'#
HEU_NET_DECORATION = 'heu_net_decoration'#
pm4py.algo.discovery.heuristics.variants.classic.apply(log: EventLog, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters:
  • log – Event log

  • parameters – Possible parameters of the algorithm, including:

    • Parameters.ACTIVITY_KEY

    • Parameters.TIMESTAMP_KEY

    • Parameters.CASE_ID_KEY

    • Parameters.DEPENDENCY_THRESH

    • Parameters.AND_MEASURE_THRESH

    • Parameters.MIN_ACT_COUNT

    • Parameters.MIN_DFG_OCCURRENCES

    • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

    • Parameters.LOOP_LENGTH_TWO_THRESH

Returns:

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_pandas(df: DataFrame, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters:
  • df – Pandas dataframe

  • parameters – Possible parameters of the algorithm, including: activity_key, case_id_glue, timestamp_key, dependency_thresh, and_measure_thresh, min_act_count, min_dfg_occurrences, dfg_pre_cleaning_noise_thresh, loops_length_two_thresh

Returns:

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_dfg(dfg: Dict[Tuple[str, str], int], activities=None, activities_occurrences=None, start_activities=None, end_activities=None, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters:
  • dfg – Directly-Follows Graph

  • activities – (If provided) list of activities of the log

  • activities_occurrences – (If provided) dictionary of activities occurrences

  • start_activities – (If provided) dictionary of start activities occurrences

  • end_activities – (If provided) dictionary of end activities occurrences

  • parameters – Possible parameters of the algorithm, including:

    • Parameters.ACTIVITY_KEY

    • Parameters.TIMESTAMP_KEY

    • Parameters.CASE_ID_KEY

    • Parameters.DEPENDENCY_THRESH

    • Parameters.AND_MEASURE_THRESH

    • Parameters.MIN_ACT_COUNT

    • Parameters.MIN_DFG_OCCURRENCES

    • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

    • Parameters.LOOP_LENGTH_TWO_THRESH

Returns:

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_heu(log: EventLog, parameters: Dict[Any, Any] | None = None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters:
  • log – Event log

  • parameters – Possible parameters of the algorithm, including:

    • Parameters.ACTIVITY_KEY

    • Parameters.TIMESTAMP_KEY

    • Parameters.CASE_ID_KEY

    • Parameters.DEPENDENCY_THRESH

    • Parameters.AND_MEASURE_THRESH

    • Parameters.MIN_ACT_COUNT

    • Parameters.MIN_DFG_OCCURRENCES

    • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

    • Parameters.LOOP_LENGTH_TWO_THRESH

Returns:

Heuristics Net

Return type:

heu

pm4py.algo.discovery.heuristics.variants.classic.apply_heu_pandas(df: DataFrame, parameters: Dict[str | Parameters, Any] | None = None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters:
  • df – Pandas dataframe

  • parameters – Possible parameters of the algorithm, including:

    • Parameters.ACTIVITY_KEY

    • Parameters.TIMESTAMP_KEY

    • Parameters.CASE_ID_KEY

    • Parameters.DEPENDENCY_THRESH

    • Parameters.AND_MEASURE_THRESH

    • Parameters.MIN_ACT_COUNT

    • Parameters.MIN_DFG_OCCURRENCES

    • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

    • Parameters.LOOP_LENGTH_TWO_THRESH

Returns:

Heuristics Net

Return type:

heu

pm4py.algo.discovery.heuristics.variants.classic.apply_heu_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, dfg_window_2=None, freq_triples=None, performance_dfg=None, parameters=None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters:
  • dfg – Directly-Follows Graph

  • activities – (If provided) list of activities of the log

  • activities_occurrences – (If provided) dictionary of activities occurrences

  • start_activities – (If provided) dictionary of start activities occurrences

  • end_activities – (If provided) dictionary of end activities occurrences

  • dfg_window_2 – (If provided) DFG of window 2

  • freq_triples – (If provided) Frequency triples

  • performance_dfg – (If provided) Performance DFG

  • parameters – Possible parameters of the algorithm, including:

    • Parameters.ACTIVITY_KEY

    • Parameters.TIMESTAMP_KEY

    • Parameters.CASE_ID_KEY

    • Parameters.DEPENDENCY_THRESH

    • Parameters.AND_MEASURE_THRESH

    • Parameters.MIN_ACT_COUNT

    • Parameters.MIN_DFG_OCCURRENCES

    • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

    • Parameters.LOOP_LENGTH_TWO_THRESH

Returns:

Heuristics Net

Return type:

heu

pm4py.algo.discovery.heuristics.variants.classic.calculate(heu_net, dependency_thresh=0.5, and_measure_thresh=0.65, min_act_count=1, min_dfg_occurrences=1, dfg_pre_cleaning_noise_thresh=0.05, loops_length_two_thresh=0.5, parameters=None)[source]#

Calculate the dependency matrix, populate the nodes

Parameters:
  • dependency_thresh – (Optional) dependency threshold

  • and_measure_thresh – (Optional) AND measure threshold

  • min_act_count – (Optional) minimum number of occurrences of an activity

  • min_dfg_occurrences – (Optional) minimum dfg occurrences

  • dfg_pre_cleaning_noise_thresh – (Optional) DFG pre cleaning noise threshold

  • loops_length_two_thresh – (Optional) loops length two threshold

  • parameters – Other parameters of the algorithm