pm4py.objects.log.util.get_prefixes module#

pm4py.objects.log.util.get_prefixes.get_prefixes_from_log(log: EventLog, length: int) EventLog[source]#

Gets the prefixes of a log of a given length

Parameters:
  • log – Event log

  • length – Length

Returns:

Log contain the prefixes: - if a trace has lower or identical length, it is included as-is - if a trace has greater length, it is cut

Return type:

prefix_log

pm4py.objects.log.util.get_prefixes.get_log_with_log_prefixes(log, parameters=None)[source]#

Gets an extended log that contains, in order, all the prefixes for a case of the original log

Parameters:
  • log – Original log

  • parameters – Possible parameters of the algorithm

Returns:

  • all_prefixes_log – Log with all the prefixes

  • change_indexes – Indexes of the extended log where there was a change between cases

pm4py.objects.log.util.get_prefixes.get_log_traces_to_activities(log, activities, parameters=None)[source]#

Get sublogs taking to each one of the specified activities

Parameters:
  • log – Trace log object

  • activities – List of activities in the log

  • parameters

    Possible parameters of the algorithm, including:

    PARAMETER_CONSTANT_ACTIVITY_KEY -> activity PARAMETER_CONSTANT_TIMESTAMP_KEY -> timestamp

Returns:

  • list_logs – List of event logs taking to the first occurrence of each activity

  • considered_activities – All activities that are effectively have been inserted in the list of logs (in some of them, the resulting log may be empty)

pm4py.objects.log.util.get_prefixes.get_log_traces_until_activity(log, activity, parameters=None)[source]#

Gets a reduced version of the log containing, for each trace, only the events before a specified activity

Parameters:
  • log – Trace log

  • activity – Activity to reach

  • parameters

    Possible parameters of the algorithm, including:

    PARAMETER_CONSTANT_ACTIVITY_KEY -> activity PARAMETER_CONSTANT_TIMESTAMP_KEY -> timestamp

Returns:

New log

Return type:

new_log