process_mining / pm4py /examples /batch_detection.py
linpershey's picture
Add 'pm4py/' from commit '80970016c5e1e79af7c37df0dd88e17587fe7bcf'
b4ba3ec
raw
history blame
561 Bytes
import pm4py
from pm4py.algo.discovery.batches import algorithm
import os
def execute_script():
log = pm4py.read_xes(os.path.join("..", "tests", "input_data", "receipt.xes"))
# detect the batches from the event log
batches = algorithm.apply(log)
# print the batches (complete information) in a single row
print(batches)
# print a summary information (size) for each activity-resource combination that is performed in batches
for batch in batches:
print(batch[0], batch[1])
if __name__ == "__main__":
execute_script()