pm4py.algo.filtering.log.traces package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

pm4py.algo.filtering.log.traces.trace_filter module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.filtering.log.traces.trace_filter.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
POSITIVE = 'positive'#
pm4py.algo.filtering.log.traces.trace_filter.apply(log: EventLog | EventStream | DataFrame, admitted_traces: List[List[str]], parameters: Dict[Any, Any] | None = None) EventLog[source]#

Filters an event log on a set of traces. A trace is a sequence of activities and “…”, in which: - a “…” before an activity tells that other activities can precede the given activity - a “…” after an activity tells that other activities can follow the given activity

For example: - apply(log, [[“A”, “B”]]) <- filters only the cases of the event log having exactly the process variant A,B - apply(log, [[”…”, “A”, “B”]]) <- filters only the cases of the event log ending with the activities A,B - apply(log, [[“A”, “B”, “…”]]) <- filters only the cases of the event log starting with the activities A,B - apply(log, [[”…”, “A”, “B”, “C”, “…”], [”…”, “D”, “E”, “F”, “…”]]

<- filters only the cases of the event log in which at any point

there is A followed by B followed by C, and in which at any other point there is D followed by E followed by F

Parameters#

log

Event log

admitted_traces

Collection of traces admitted from the filter (with the aforementioned criteria)

parameters

Parameters of the method, including: - Parameters.ACTIVITY_KEY => the attribute that should be used as activity - Parameters.POSITIVE => indicates if the filter should keep/discard the cases satisfying the filter