pm4py.algo.filtering.log.paths package

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.Enum

An enumeration.

ATTRIBUTE_KEY = 'pm4py:param:attribute_key'
DECREASING_FACTOR = 'decreasingFactor'
MAX_PERFORMANCE = 'max_performance'
MIN_PERFORMANCE = 'min_performance'
POSITIVE = 'positive'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.algo.filtering.log.paths.paths_filter.apply(log: pm4py.objects.log.obj.EventLog, paths: List[Tuple[str, str]], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.paths.paths_filter.Parameters], Any]] = None) pm4py.objects.log.obj.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

Return type

filtered_log

pm4py.algo.filtering.log.paths.paths_filter.apply_auto_filter(log, variants=None, parameters=None)[source]

Apply an attributes filter detecting automatically a percentage

Parameters
  • log – Log

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

  • parameters

    Parameters of the algorithm, including:

    Parameters.DECREASING_FACTOR -> Decreasing factor (stops the algorithm when the next activity by occurrence is below this factor in comparison to previous) Parameters.ATTRIBUTE_KEY -> Attribute key (must be specified if different from concept:name)

Returns

Filtered log

Return type

filtered_log

Deprecated since version 2.2.11: This will be removed in 3.0.0. Removed

pm4py.algo.filtering.log.paths.paths_filter.apply_performance(log: pm4py.objects.log.obj.EventLog, provided_path: Tuple[str, str], parameters: Optional[Dict[Union[str, pm4py.algo.filtering.log.paths.paths_filter.Parameters], Any]] = None) pm4py.objects.log.obj.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 event log

Return type

filtered_log

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

Return type

filtered_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

Dictionary of paths associated with their count

Return type

paths

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

Paths cutting threshold

Return type

threshold

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

Sorted paths list

Return type

listpaths

Module contents

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/>.