pm4py.ocel.sample_ocel_objects#

pm4py.ocel.sample_ocel_objects(ocel: OCEL, num_objects: int) OCEL[source]#

Returns a sampled object-centric event log containing a random subset of objects. Only events related to at least one of the sampled objects are included in the returned log. Note that this sampling may disrupt the relationships between different objects.

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

  • num_objects (int) – Number of objects to include in the sampled event log.

Returns:

Sampled object-centric event log.

Return type:

OCEL

import pm4py

ocel = pm4py.read_ocel('trial.ocel')
sampled_ocel = pm4py.sample_ocel_objects(ocel, 50)  # Keeps only 50 random objects