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

class pm4py.algo.discovery.heuristics.variants.plusplus.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'#
HEU_NET_DECORATION = 'heu_net_decoration'#
pm4py.algo.discovery.heuristics.variants.plusplus.apply(log: EventLog, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, 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_pandas(df: DataFrame, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, 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.apply_heu(log: EventLog, parameters: Dict[Any, Any] | None = None) 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.discover_abstraction_log(log: EventLog, parameters: Dict[Any, Any] | None = 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.apply_heu_pandas(df: DataFrame, parameters: Dict[Any, Any] | None = None) 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.discover_abstraction_dataframe(df: DataFrame, parameters: Dict[Any, Any] | None = 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_heu_net_plus_plus(start_activities, end_activities, activities_occurrences, dfg, performance_dfg, sojourn_time, concurrent_activities, parameters: Dict[Any, Any] | None = 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

pm4py.algo.discovery.heuristics.variants.plusplus.calculate(heu_net: HeuristicsNet, dependency_thresh: float, and_measure_thresh: float, heu_net_decoration: str) 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_dependency(heu_net: HeuristicsNet, dependency_thresh: float, heu_net_decoration: str) 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.calculate_and_out_measure(heu_net: HeuristicsNet, and_measure_thresh: float) 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_and_in_measure(heu_net: HeuristicsNet, and_measure_thresh: float) 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.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_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, dfg_window_2=None, freq_triples=None, parameters=None)[source]#