pm4py.algo.filtering.log.traces package#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

Submodules#

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

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.filtering.log.traces.trace_filter.Parameters(value)[source]#

Bases: Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'#
POSITIVE = 'positive'#
pm4py.algo.filtering.log.traces.trace_filter.apply(log: Union[EventLog, EventStream, DataFrame], admitted_traces: List[List[str]], parameters: Optional[Dict[Any, Any]] = 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