pm4py.stats.get_frequent_trace_segments#

pm4py.stats.get_frequent_trace_segments(log: Union[EventLog, DataFrame], min_occ: int, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Counter[source]#

Get the traces (segments of activities) from an event log object. Each trace is preceded and followed by “…”, reminding that the trace/segment can be preceded and followed by any other set of activities.

Parameters:
  • log – event log

  • min_occ (int) – minimum number of occurrence of a trace in order to be included

  • activity_key (str) – the attribute to be used as activity

  • timestamp_key (str) – the attribute to be used as timestamp

  • case_id_key (str) – the attribute to be used as case identifier (for Pandas dataframes)

Return type:

TCounter

import pm4py

log = pm4py.read_xes("tests/input_data/receipt.xes")
traces = pm4py.get_frequent_trace_segments(log, min_occ=100)
print(traces)