pm4py.algo.filtering.log.paths package

Submodules

pm4py.algo.filtering.log.paths.paths_filter module

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'
POSITIVE = 'positive'
pm4py.algo.filtering.log.paths.paths_filter.apply(log, paths, parameters=None)[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

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