pm4py.algo.discovery.correlation_mining.variants.trace_based module#

class pm4py.algo.discovery.correlation_mining.variants.trace_based.Parameters(*values)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
INDEX_KEY = 'index_key'#
pm4py.algo.discovery.correlation_mining.variants.trace_based.apply(log: EventLog | EventStream | DataFrame, parameters: Dict[str | Parameters, Any] | None = None) Tuple[Dict[Tuple[str, str], int], Dict[Tuple[str, str], float]][source]#

Novel approach of correlation mining, that creates the PS-matrix and the duration matrix using the order list of events of each trace of the log

Parameters:
  • log – Event log

  • parameters – Parameters

Returns:

  • dfg – DFG

  • performance_dfg – Performance DFG (containing the estimated performance for the arcs)

pm4py.algo.discovery.correlation_mining.variants.trace_based.resolve_lp_get_dfg(PS_matrix, duration_matrix, activities, activities_counter)[source]#

Resolves a LP problem to get a DFG

Parameters:
  • PS_matrix – Precede-succeed matrix

  • duration_matrix – Duration matrix

  • activities – List of activities of the log

  • activities_counter – Counter for the activities of the log

Returns:

  • dfg – Frequency DFG

  • performance_dfg – Performance DFG

pm4py.algo.discovery.correlation_mining.variants.trace_based.get_PS_duration_matrix(activities, trace_grouped_list, parameters=None)[source]#

Gets the precede-succeed matrix

Parameters:
  • activities – Activities

  • trace_grouped_list – Grouped list of simplified traces (per activity)

  • parameters – Parameters of the algorithm

Returns:

  • PS_matrix – precede-succeed matrix

  • duration_matrix – Duration matrix

pm4py.algo.discovery.correlation_mining.variants.trace_based.preprocess_log(log, activities=None, activities_counter=None, parameters=None)[source]#

Preprocess the log to get a grouped list of simplified traces (per activity)

Parameters:
  • log – Log object

  • activities – (if provided) activities of the log

  • activities_counter – (if provided) counter of the activities of the log

  • parameters – Parameters of the algorithm

Returns:

  • traces_list – List of simplified traces of the log

  • trace_grouped_list – Grouped list of simplified traces (per activity)

  • activities – Activities of the log

  • activities_counter – Activities counter

pm4py.algo.discovery.correlation_mining.variants.trace_based.get_precede_succeed_matrix(activities, trace_grouped_list, timestamp_key, start_timestamp_key)[source]#

Calculates the precede succeed matrix

Parameters:
  • activities – Sorted list of activities of the log

  • trace_grouped_list – A list of lists of lists, containing for each trace and each activity the events having such activity

  • timestamp_key – The key to be used as timestamp

  • start_timestamp_key – The key to be used as start timestamp

Returns:

The precede succeed matrix

Return type:

mat

pm4py.algo.discovery.correlation_mining.variants.trace_based.get_duration_matrix(activities, trace_grouped_list, timestamp_key, start_timestamp_key)[source]#

Calculates the duration matrix

Parameters:
  • activities – Sorted list of activities of the log

  • trace_grouped_list – A list of lists of lists, containing for each trace and each activity the events having such activity

  • timestamp_key – The key to be used as timestamp

  • start_timestamp_key – The key to be used as start timestamp

Returns:

The duration matrix

Return type:

mat