pm4py.filtering#

The pm4py.filtering module contains the filtering features offered in pm4py

Functions

filter_activities_rework(log, activity[, ...])

Filters the event log, keeping the cases where the specified activity occurs at least min_occurrences times.

filter_activity_done_different_resources(...)

Filters the cases where an activity is repeated by different resources.

filter_between(log, act1, act2[, ...])

Finds all the sub-cases leading from an event with activity "act1" to an event with activity "act2" in the log, and returns a log containing only them.

filter_case_performance(log, ...[, ...])

Filters the event log, keeping the cases having a duration (the timestamp of the last event minus the timestamp of the first event) included between min_performance and max_performance

filter_case_size(log, min_size, max_size[, ...])

Filters the event log, keeping the cases having a length (number of events) included between min_size and max_size

filter_directly_follows_relation(log, relations)

Retain traces that contain any of the specified 'directly follows' relations.

filter_end_activities(log, activities[, ...])

Filter cases having an end activity in the provided list

filter_event_attribute_values(log, ...[, ...])

Filter a log object on the values of some event attribute

filter_eventually_follows_relation(log, ...)

Retain traces that contain any of the specified 'eventually follows' relations.

filter_four_eyes_principle(log, activity1, ...)

Filter the cases of the log which violates the four eyes principle on the provided activities.

filter_log_relative_occurrence_event_attribute(...)

Filters the event log keeping only the events having an attribute value which occurs: - in at least the specified (min_relative_stake) percentage of events, when level="events" - in at least the specified (min_relative_stake) percentage of cases, when level="cases"

filter_ocel_cc_activity(ocel, activity)

Filters the objects belonging to the connected components having at least an event with the provided activity.

filter_ocel_cc_length(ocel, min_cc_length, ...)

Keeps only the objects in an OCEL belonging to a connected component with a length falling in a specified range

filter_ocel_cc_object(ocel, object_id[, ...])

Returns the connected component of the object-centric event log to which the object with the provided identifier belongs.

filter_ocel_cc_otype(ocel, otype[, positive])

Filters the objects belonging to the connected components having at least an object of the provided object type.

filter_ocel_end_events_per_object_type(ocel, ...)

Filters the events in which an object for the given object type terminates its lifecycle.

filter_ocel_event_attribute(ocel, ...[, ...])

Filters the object-centric event log on the provided event attributes values

filter_ocel_events(ocel, event_identifiers)

Filters the event identifiers of an object-centric event log.

filter_ocel_events_timestamp(ocel, ...[, ...])

Filters the object-centric event log keeping events in the provided timestamp range

filter_ocel_object_attribute(ocel, ...[, ...])

Filters the object-centric event log on the provided object attributes values

filter_ocel_object_per_type_count(ocel, ...)

Filters the events of the object-centric logs which are related to at least the specified amount of objects per type.

filter_ocel_object_types(ocel, obj_types[, ...])

Filters the object types of an object-centric event log.

filter_ocel_object_types_allowed_activities(...)

Filters an object-centric event log keeping only the specified object types with the specified activity set (filters out the rest).

filter_ocel_objects(ocel, object_identifiers)

Filters the object identifiers of an object-centric event log.

filter_ocel_start_events_per_object_type(...)

Filters the events in which a new object for the given object type is spawn.

filter_paths_performance(log, path, ...[, ...])

Filters the event log, either: - (keep=True) keeping the cases having the specified path (tuple of 2 activities) with a duration included between min_performance and max_performance - (keep=False) discarding the cases having the specified path with a duration included between min_performance and max_performance

filter_prefixes(log, activity[, strict, ...])

Filters the log, keeping the prefixes to a given activity.

filter_start_activities(log, activities[, ...])

Filter cases having a start activity in the provided list

filter_suffixes(log, activity[, strict, ...])

Filters the log, keeping the suffixes from a given activity.

filter_time_range(log, dt1, dt2[, mode, ...])

Filter a log on a time interval

filter_trace_attribute_values(log, ...[, ...])

Filter a log on the values of a trace attribute

filter_variants(log, variants[, retain, ...])

Filter a log on a specified set of variants

filter_variants_by_coverage_percentage(log, ...)

Filters the variants of the log by a coverage percentage (e.g., if min_coverage_percentage=0.4, and we have a log with 1000 cases, of which 500 of the variant 1, 400 of the variant 2, and 100 of the variant 3, the filter keeps only the traces of variant 1 and variant 2).

filter_variants_by_maximum_coverage_percentage(...)

Filters the variants of the log by a maximum coverage percentage (e.g., if max_coverage_percentage=0.4, and we have a log with 1000 cases, of which 500 of the variant 1, 400 of the variant 2, and 100 of the variant 3, the filter keeps only the traces of variant 2 and variant 3).

filter_variants_top_k(log, k[, ...])

Keeps the top-k variants of the log