pm4py.ocel.sample_ocel_connected_components#

pm4py.ocel.sample_ocel_connected_components(ocel: OCEL, connected_components: int = 1, max_num_events_per_cc: int = 9223372036854775807, max_num_objects_per_cc: int = 9223372036854775807, max_num_e2o_relations_per_cc: int = 9223372036854775807) OCEL[source]#

Given an object-centric event log, returns a sampled event log with a subset of the executions. The number of considered connected components need to be specified by the user.

Paper: Adams, Jan Niklas, et al. “Defining cases and variants for object-centric event data.” 2022 4th International Conference on Process Mining (ICPM). IEEE, 2022.

Parameters:
  • ocel (OCEL) – Object-centric event log

  • connected_components (int) – Number of connected components to pick from the OCEL

  • max_num_events_per_cc (int) – maximum number of events allowed per connected component (default: sys.maxsize)

  • max_num_objects_per_cc (int) – maximum number of events allowed per connected component (default: sys.maxsize)

  • max_num_e2o_relations_per_cc (int) – maximum number of event-to-object relationships allowed per connected component (default: sys.maxsize)

Return type:

OCEL

import pm4py

ocel = pm4py.read_ocel('trial.ocel')
sampled_ocel = pm4py.sample_ocel_connected_components(ocel, 5) # keeps only 5 connected components