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

class pm4py.algo.discovery.correlation_mining.variants.classic.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'#
EXACT_TIME_MATCHING = 'exact_time_matching'#
INDEX_KEY = 'index_key'#
pm4py.algo.discovery.correlation_mining.variants.classic.apply(log: EventLog | EventStream | DataFrame, parameters: Dict[str | Parameters, Any] | None = None) Tuple[Dict[Tuple[str, str], int], Dict[Tuple[str, str], float]][source]#

Apply the correlation miner to an event stream (other types of logs are converted to that)

The approach is described in: Pourmirza, Shaya, Remco Dijkman, and Paul Grefen. “Correlation miner: mining business process models and event correlations without case identifiers.” International Journal of Cooperative Information Systems 26.02 (2017): 1742002.

Parameters:
  • log – Log object

  • parameters – Parameters of the algorithm

Returns:

  • dfg – DFG

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

pm4py.algo.discovery.correlation_mining.variants.classic.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 of the activities

Returns:

  • dfg – DFG

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

pm4py.algo.discovery.correlation_mining.variants.classic.get_PS_dur_matrix(activities_grouped, activities, parameters=None)[source]#

Combined methods to get the two matrixes

Parameters:
  • activities_grouped – Grouped activities

  • activities – List of activities of the log

  • parameters – Parameters of the algorithm

Returns:

  • PS_matrix – Precede-succeed matrix

  • duration_matrix – Duration matrix

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

Preprocess a log to enable correlation mining

Parameters:
  • log – Log object

  • activities – (if provided) list of activities of the log

  • parameters – Parameters of the algorithm

Returns:

  • transf_stream – Transformed stream

  • activities_grouped – Grouped activities

  • activities – List of activities of the log

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

Calculates the precede succeed matrix

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

  • activities_grouped – Grouped list of activities

  • timestamp_key – Timestamp key

  • start_timestamp_key – Start timestamp key (events start)

Returns:

Precede succeed matrix

Return type:

precede_succeed_matrix

pm4py.algo.discovery.correlation_mining.variants.classic.get_duration_matrix(activities, activities_grouped, timestamp_key, start_timestamp_key, exact=False)[source]#

Calculates the duration matrix

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

  • activities_grouped – Grouped list of activities

  • timestamp_key – Timestamp key

  • start_timestamp_key – Start timestamp key (events start)

  • exact – Performs an exact matching of the times (True/False)

Returns:

Duration matrix

Return type:

duration_matrix