pm4py.algo.evaluation.generalization.variants package

Submodules

pm4py.algo.evaluation.generalization.variants.token_based module

class pm4py.algo.evaluation.generalization.variants.token_based.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
pm4py.algo.evaluation.generalization.variants.token_based.apply(log, petri_net, initial_marking, final_marking, parameters=None)[source]

Calculates generalization on the provided log and Petri net.

The approach has been suggested by the paper Buijs, Joos CAM, Boudewijn F. van Dongen, and Wil MP van der Aalst. “Quality dimensions in process discovery: The importance of fitness, precision, generalization and simplicity.” International Journal of Cooperative Information Systems 23.01 (2014): 1440001.

A token replay is applied and, for each transition, we can measure the number of occurrences in the replay. The following formula is applied for generalization

sum_{t in transitions} (math.sqrt(1.0/(n_occ_replay(t)))

1 - ———————————————————-

# transitions

Parameters
  • log – Trace log

  • petri_net – Petri net

  • initial_marking – Initial marking

  • final_marking – Final marking

  • parameters – Algorithm parameters

Returns

Generalization measure

Return type

generalization

pm4py.algo.evaluation.generalization.variants.token_based.get_generalization(petri_net, aligned_traces)[source]

Gets the generalization from the Petri net and the list of activated transitions during the replay

The approach has been suggested by the paper Buijs, Joos CAM, Boudewijn F. van Dongen, and Wil MP van der Aalst. “Quality dimensions in process discovery: The importance of fitness, precision, generalization and simplicity.” International Journal of Cooperative Information Systems 23.01 (2014): 1440001.

A token replay is applied and, for each transition, we can measure the number of occurrences in the replay. The following formula is applied for generalization

sum_{t in transitions} (math.sqrt(1.0/(n_occ_replay(t)))

1 - ———————————————————-

# transitions

Parameters
  • petri_net – Petri net

  • aligned_traces – Result of the token-replay

Returns

Generalization measure

Return type

generalization

Module contents