pm4py.algo.evaluation.replay_fitness.variants package

Submodules

pm4py.algo.evaluation.replay_fitness.variants.alignment_based module

class pm4py.algo.evaluation.replay_fitness.variants.alignment_based.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
ATTRIBUTE_KEY = 'pm4py:param:attribute_key'
CLEANING_TOKEN_FLOOD = 'cleaning_token_flood'
MULTIPROCESSING = 'multiprocessing'
TOKEN_REPLAY_VARIANT = 'token_replay_variant'
pm4py.algo.evaluation.replay_fitness.variants.alignment_based.apply(log, petri_net, initial_marking, final_marking, align_variant=<Variants.VERSION_STATE_EQUATION_A_STAR: <module 'pm4py.algo.conformance.alignments.petri_net.variants.state_equation_a_star' from 'C:\\Users\\berti\\FRAUNHOFER\\pm4py-core\\pm4py\\algo\\conformance\\alignments\\petri_net\\variants\\state_equation_a_star.py'>>, parameters=None)[source]

Evaluate fitness based on alignments

Parameters
  • log – Event log

  • petri_net – Petri net

  • initial_marking – Initial marking

  • final_marking – Final marking

  • align_variant – Variants of the alignments to apply

  • parameters – Parameters of the algorithm

Returns

Containing two keys (percFitTraces and averageFitness)

Return type

dictionary

pm4py.algo.evaluation.replay_fitness.variants.alignment_based.apply_trace(trace, petri_net, initial_marking, final_marking, best_worst, activity_key)[source]

Performs the basic alignment search, given a trace, a net and the costs of the “best of the worst”. The costs of the best of the worst allows us to deduce the fitness of the trace. We compute the fitness by means of 1 - alignment costs / best of worst costs (i.e. costs of 0 => fitness 1)

Parameters
  • trace (list input trace, assumed to be a list of events (i.e. the code will use the activity key to)

  • get the attributes)

  • petri_net (pm4py.objects.petri.net.PetriNet the Petri net to use in the alignment)

  • initial_marking (pm4py.objects.petri.net.Marking initial marking in the Petri net)

  • final_marking (pm4py.objects.petri.net.Marking final marking in the Petri net)

  • best_worst (cost of the best worst alignment of a trace (empty trace aligned to the model))

  • activity_key (str (optional) key to use to identify the activity described by the events)

Returns

dictionary

Return type

dict with keys alignment, cost, visited_states, queued_states and traversed_arcs

pm4py.algo.evaluation.replay_fitness.variants.alignment_based.evaluate(aligned_traces, parameters=None)[source]

Transforms the alignment result to a simple dictionary including the percentage of fit traces and the average fitness

Parameters
  • aligned_traces – Alignments calculated for the traces in the log

  • parameters – Possible parameters of the evaluation

Returns

Containing two keys (percFitTraces and averageFitness)

Return type

dictionary

pm4py.algo.evaluation.replay_fitness.variants.token_replay module

class pm4py.algo.evaluation.replay_fitness.variants.token_replay.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
ATTRIBUTE_KEY = 'pm4py:param:attribute_key'
CLEANING_TOKEN_FLOOD = 'cleaning_token_flood'
MULTIPROCESSING = 'multiprocessing'
TOKEN_REPLAY_VARIANT = 'token_replay_variant'
pm4py.algo.evaluation.replay_fitness.variants.token_replay.apply(log, petri_net, initial_marking, final_marking, parameters=None)[source]

Apply token replay fitness evaluation

Parameters
  • log – Trace log

  • petri_net – Petri net

  • initial_marking – Initial marking

  • final_marking – Final marking

  • parameters – Parameters

Returns

Containing two keys (percFitTraces and averageFitness)

Return type

dictionary

pm4py.algo.evaluation.replay_fitness.variants.token_replay.evaluate(aligned_traces, parameters=None)[source]

Gets a dictionary expressing fitness in a synthetic way from the list of boolean values saying if a trace in the log is fit, and the float values of fitness associated to each trace

Parameters
  • aligned_traces – Result of the token-based replayer

  • parameters – Possible parameters of the evaluation

Returns

Containing two keys (percFitTraces and averageFitness)

Return type

dictionary

Module contents