pm4py.algo.discovery.heuristics.variants package

Submodules

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

class pm4py.algo.discovery.heuristics.variants.classic.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
AND_MEASURE_THRESH = 'and_measure_thresh'
CASE_ID_KEY = 'case_id_glue'
DEPENDENCY_THRESH = 'dependency_thresh'
DFG_PRE_CLEANING_NOISE_THRESH = 'dfg_pre_cleaning_noise_thresh'
HEU_NET_DECORATION = 'heu_net_decoration'
LOOP_LENGTH_TWO_THRESH = 'loop_length_two_thresh'
MIN_ACT_COUNT = 'min_act_count'
MIN_DFG_OCCURRENCES = 'min_dfg_occurrences'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.algo.discovery.heuristics.variants.classic.apply(log, parameters=None)[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_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, parameters=None)[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, parameters=None)[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_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)[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.apply_pandas(df, parameters=None)[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.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

pm4py.algo.discovery.heuristics.variants.plusplus module

class pm4py.algo.discovery.heuristics.variants.plusplus.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
AND_MEASURE_THRESH = 'and_measure_thresh'
CASE_ID_KEY = 'case_id_glue'
DEPENDENCY_THRESH = 'dependency_thresh'
HEU_NET_DECORATION = 'heu_net_decoration'
MIN_ACT_COUNT = 'min_act_count'
MIN_DFG_OCCURRENCES = 'min_dfg_occurrences'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.algo.discovery.heuristics.variants.plusplus.apply(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Any, Any]] = None) → Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Discovers a Petri net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters
  • log – Event log

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.heuristics.variants.plusplus.apply_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, parameters=None)[source]
pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Any, Any]] = None)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters
  • log – Event log

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns

Heuristics net

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, dfg_window_2=None, freq_triples=None, parameters=None)[source]
pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu_pandas(df: pandas.core.frame.DataFrame, parameters: Optional[Dict[Any, Any]] = None)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters
  • df – Dataframe

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns

Heuristics net

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.apply_pandas(df: pandas.core.frame.DataFrame, parameters: Optional[Dict[Any, Any]] = None) → Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Discovers a Petri net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters
  • df – Dataframe

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.heuristics.variants.plusplus.calculate(heu_net: pm4py.objects.heuristics_net.obj.HeuristicsNet, dependency_thresh: float, and_measure_thresh: float, heu_net_decoration: str)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Calculates the dependency matrix and the AND measures using the Heuristics Miner ++ formulas

Parameters
  • heu_net – Heuristics net

  • dependency_thresh – Dependency threshold

  • and_measure_thresh – AND measure threshold

  • heu_net_decoration – Decoration to use (frequency/performance)

Returns

Heuristics net

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_and_in_measure(heu_net: pm4py.objects.heuristics_net.obj.HeuristicsNet, and_measure_thresh: float)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Calculates the AND measure for incoming edges using the Heuristics Miner ++ formula

Parameters
  • heu_net – Heuristics net

  • and_measure_thresh – And measure threshold

Returns

Heuristics net (enriched)

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_and_out_measure(heu_net: pm4py.objects.heuristics_net.obj.HeuristicsNet, and_measure_thresh: float)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Calculates the AND measure for outgoing edges using the Heuristics Miner ++ formula

Parameters
  • heu_net – Heuristics net

  • and_measure_thresh – And measure threshold

Returns

Heuristics net (enriched)

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_dependency(heu_net: pm4py.objects.heuristics_net.obj.HeuristicsNet, dependency_thresh: float, heu_net_decoration: str)pm4py.objects.heuristics_net.obj.HeuristicsNet[source]

Calculates the dependency matrix using the Heuristics Miner ++ formula

Parameters
  • heu_net – Heuristics net

  • dependency_thresh – Dependency threshold

  • heu_net_decoration – Decoration to include (frequency/performance)

Returns

Heuristics net (enriched)

Return type

heu_net

pm4py.algo.discovery.heuristics.variants.plusplus.discover_abstraction_dataframe(df: pandas.core.frame.DataFrame, parameters: Optional[Dict[Any, Any]] = None) → Tuple[Any, Any, Any, Any, Any, Any, Any][source]

Discovers an abstraction from a dataframe that is useful for the Heuristics Miner ++ algorithm

Parameters
  • df – Dataframe

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY

Returns

  • start_activities – Start activities

  • end_activities – End activities

  • activities_occurrences – Activities along with their number of occurrences

  • dfg – Directly-follows graph

  • performance_dfg – (Performance) Directly-follows graph

  • sojourn_time – Sojourn time for each activity

  • concurrent_activities – Concurrent activities

pm4py.algo.discovery.heuristics.variants.plusplus.discover_abstraction_log(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Any, Any]] = None) → Tuple[Any, Any, Any, Any, Any, Any, Any][source]

Discovers an abstraction from a log that is useful for the Heuristics Miner ++ algorithm

Parameters
  • log – Event log

  • parameters – Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY

Returns

  • start_activities – Start activities

  • end_activities – End activities

  • activities_occurrences – Activities along with their number of occurrences

  • dfg – Directly-follows graph

  • performance_dfg – (Performance) Directly-follows graph

  • sojourn_time – Sojourn time for each activity

  • concurrent_activities – Concurrent activities

pm4py.algo.discovery.heuristics.variants.plusplus.discover_heu_net_plus_plus(start_activities, end_activities, activities_occurrences, dfg, performance_dfg, sojourn_time, concurrent_activities, parameters: Optional[Dict[Any, Any]] = None)[source]

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters
  • start_activities – Start activities

  • end_activities – End activities

  • activities_occurrences – Activities along with their number of occurrences

  • dfg – Directly-follows graph

  • performance_dfg – (Performance) Directly-follows graph

  • sojourn_time – Sojourn time for each activity

  • concurrent_activities – Concurrent activities

  • parameters – Parameters of the algorithm, including: - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns

Heuristics net

Return type

heu_net

Module contents