pm4py.algo.filtering.log.paths 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.paths.paths_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.paths.paths_filter.Parameters(value)[source]#

Bases: Enum

An enumeration.

ATTRIBUTE_KEY = 'pm4py:param:attribute_key'#
DECREASING_FACTOR = 'decreasingFactor'#
POSITIVE = 'positive'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
MIN_PERFORMANCE = 'min_performance'#
MAX_PERFORMANCE = 'max_performance'#
pm4py.algo.filtering.log.paths.paths_filter.apply(log: EventLog, paths: List[Tuple[str, str]], parameters: Optional[Dict[Union[str, Parameters], Any]] = None) EventLog[source]#

Apply a filter on traces containing / not containing a path

Parameters#

log

Log

paths

Paths that we are looking for (expressed as tuple of 2 strings)

parameters
Parameters of the algorithm, including:

Parameters.ATTRIBUTE_KEY -> Attribute identifying the activity in the log Parameters.POSITIVE -> Indicate if events should be kept/removed

Returns#

filtered_log

Filtered log

pm4py.algo.filtering.log.paths.paths_filter.apply_performance(log: EventLog, provided_path: Tuple[str, str], parameters: Optional[Dict[Union[str, Parameters], Any]] = None) EventLog[source]#

Filters the cases of an event log where there is at least one occurrence of the provided path occurring in the defined timedelta range.

Parameters#

log

Event log

provided_path

Path between two activities (expressed as tuple)

parameters
Parameters of the filter, including:

Parameters.ATTRIBUTE_KEY -> Attribute identifying the activity in the log Parameters.TIMESTAMP_KEY -> Attribute identifying the timestamp in the log Parameters.POSITIVE -> Indicate if events should be kept/removed Parameters.MIN_PERFORMANCE -> Minimal allowed performance of the provided path Parameters.MAX_PERFORMANCE -> Maximal allowed performance of the provided path

Returns#

filtered_log

Filtered event log

pm4py.algo.filtering.log.paths.paths_filter.get_paths_from_log(log, attribute_key='concept:name')[source]#

Get the paths of the log along with their count

Parameters#

log

Log

attribute_key

Attribute key (must be specified if different from concept:name)

Returns#

paths

Dictionary of paths associated with their count

pm4py.algo.filtering.log.paths.paths_filter.get_sorted_paths_list(paths)[source]#

Gets sorted paths list

Parameters#

paths

Dictionary of paths associated with their count

Returns#

listpaths

Sorted paths list

pm4py.algo.filtering.log.paths.paths_filter.get_paths_threshold(plist, decreasing_factor)[source]#

Get end attributes cutting threshold

Parameters#

plist

List of paths ordered by number of occurrences

decreasing_factor

Decreasing factor of the algorithm

Returns#

threshold

Paths cutting threshold

pm4py.algo.filtering.log.paths.paths_filter.filter_log_by_paths(log, paths, variants, vc, threshold, attribute_key='concept:name')[source]#

Keep only paths which number of occurrences is above the threshold (or they belong to the first variant)

Parameters#

log

Log

paths

Dictionary of paths associated with their count

variants

(If specified) Dictionary with variant as the key and the list of traces as the value

vc

List of variant names along with their count

threshold

Cutting threshold (remove paths which number of occurrences is below the threshold)

attribute_key

(If specified) Specify the attribute key to use (default concept:name)

Returns#

filtered_log

Filtered log