pm4py.algo.filtering.log.paths 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.paths.paths_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.paths.paths_filter.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum
- 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: Dict[str | Parameters, Any] | None = 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: Dict[str | Parameters, Any] | None = 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