pm4py.objects.process_tree.utils 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.objects.process_tree.utils.bottomup 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
- pm4py.objects.process_tree.utils.bottomup.get_max_trace_length(tree, parameters=None)[source]#
Get the maximum length of a trace allowed by the process tree (can be infty)
Parameters#
- tree
Process tree
- parameters
Possible parameters of the algorithm: - “avoid_loops” => if True, avoid to visit loops
Returns#
- max_trace_length
The maximum length of a trace
- pm4py.objects.process_tree.utils.bottomup.get_min_trace_length(tree, parameters=None)[source]#
Get the minimum length of a trace allowed by the process tree
Parameters#
- tree
Process tree
- parameters
Possible parameters of the algorithm
Returns#
- min_trace_length
The minimum length of a trace
- pm4py.objects.process_tree.utils.bottomup.get_max_rem_dict(tree, parameters=None)[source]#
Gets for each node of the tree the maximum number of activities that are inserted to ‘complete’ a trace of the overall tree
Parameters#
- tree
Process tree
- parameters
Parameters of the algorithm
Returns#
- max_rem_dict
Dictionary described in the docstring
- pm4py.objects.process_tree.utils.bottomup.get_min_rem_dict(tree, parameters=None)[source]#
Gets for each node of the tree the minimum number of activities that are inserted to ‘complete’ a trace of the overall tree
Parameters#
- tree
Process tree
- parameters
Parameters of the algorithm
Returns#
- min_rem_dict
Dictionary described in the docstring
- pm4py.objects.process_tree.utils.bottomup.get_max_length_dict(node, max_length_dict, num_nodes, avoid_loops=False)[source]#
Populates, given the nodes of a tree in a bottom-up order, the maximum length dictionary (every trace generated from that point of the tree has at most length N)
Parameters#
- node
Node
- max_length_dict
Dictionary that is populated in-place
- num_nodes
Number of nodes in the process tree
- avoid_loops
Avoid to visit loops
- pm4py.objects.process_tree.utils.bottomup.get_min_length_dict(node, min_length_dict)[source]#
Populates, given the nodes of a tree in a bottom-up order, the minimum length dictionary (every trace generated from that point of the tree has at least length N)
Parameters#
- node
Node
- min_length_dict
Dictionary that is populated in-place
- pm4py.objects.process_tree.utils.bottomup.get_bottomup_nodes(tree, parameters=None)[source]#
Gets the nodes of a tree in a bottomup order (leafs come first, the master node comes after)
Parameters#
- tree
Process tree
- parameters
Parameters of the algorithm
Returns#
- bottomup_nodes
Nodes of the tree in a bottomup order
pm4py.objects.process_tree.utils.generic 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
- pm4py.objects.process_tree.utils.generic.fold(tree)[source]#
This method reduces a process tree by merging nodes of the form N(N(a,b),c) into N(a,b,c), i.e., where N = || or X. For example X(X(a,b),c) == X(a,b,c). Furthermore, meaningless parts, e.g., internal nodes without children, or, operators with one child are removed as well.
- Parameters:
tree
- Returns:
- pm4py.objects.process_tree.utils.generic.reduce_tau_leafs(tree)[source]#
This method reduces tau leaves that are not meaningful. For example tree ->(a, au,b) is reduced to ->(a,b). In some cases this results in constructs such as ->(a), i.e., a sequence with a single child. Such constructs are not further reduced.
- Parameters:
tree
- Returns:
- pm4py.objects.process_tree.utils.generic.project_execution_sequence_to_leafs(execution_sequence)[source]#
Project an execution sequence to the set of leafs of the tree.
Parameters#
- execution_sequence
Execution sequence on the process tree
Returns#
- list_leafs
Leafs nodes of the process tree
- pm4py.objects.process_tree.utils.generic.project_execution_sequence_to_labels(execution_sequence)[source]#
Project an execution sequence to a set of labels
Parameters#
- execution_sequence
Execution sequence on the process tree
Returns#
- list_labels
List of labels contained in the process tree
- pm4py.objects.process_tree.utils.generic.parse(string_rep)[source]#
Parse a string provided by the user to a process tree (initialization method)
Parameters#
- string_rep
String representation of the process tree
Returns#
- node
Process tree object
- pm4py.objects.process_tree.utils.generic.parse_recursive(string_rep, depth_cache, depth)[source]#
Parse a string provided by the user to a process tree (recursive method)
Parameters#
- string_rep
String representation of the process tree
- depth_cache
Depth cache of the algorithm
- depth
Current step depth
Returns#
- node
Process tree object
- pm4py.objects.process_tree.utils.generic.tree_sort(tree)[source]#
Sort a tree in such way that the order of the nodes in AND/XOR children is always the same. This is a recursive function
Parameters#
- tree
Process tree
- pm4py.objects.process_tree.utils.generic.structurally_language_equal(tree1, tree2)[source]#
this function checks if two given process trees are structurally equal, modulo, shuffling of children (if allowed), i.e., in the parallel, or and xor operators, the order does not matter.
- Parameters:
tree1
tree2
- Returns:
- pm4py.objects.process_tree.utils.generic.get_process_tree_height(pt: ProcessTree) int[source]#
calculates from the given node the max height downwards :rtype:
int:type pt:ProcessTree:param pt: process tree node :return: height
- pm4py.objects.process_tree.utils.generic.process_tree_to_binary_process_tree(tree: ProcessTree) ProcessTree[source]#
- pm4py.objects.process_tree.utils.generic.common_ancestor(t1: ProcessTree, t2: ProcessTree) ProcessTree | None[source]#
- pm4py.objects.process_tree.utils.generic.get_ancestors_until(t: ProcessTree, until: ProcessTree, include_until: bool = True) List[ProcessTree] | None[source]#
- pm4py.objects.process_tree.utils.generic.get_leaves(t: ProcessTree, leaves=None)[source]#
- pm4py.objects.process_tree.utils.generic.get_leaves_as_tuples(t: ProcessTree, leaves=None)[source]#
- pm4py.objects.process_tree.utils.generic.is_operator(tree: ProcessTree, operator: Operator) bool[source]#
- pm4py.objects.process_tree.utils.generic.is_any_operator_of(tree: ProcessTree, operators: List[Operator]) bool[source]#
- pm4py.objects.process_tree.utils.generic.is_in_state(tree: ProcessTree, target_state: OperatorState, tree_state: Dict[Tuple[int, ProcessTree], OperatorState]) bool[source]#
- pm4py.objects.process_tree.utils.generic.is_root(tree: ProcessTree) bool[source]#
pm4py.objects.process_tree.utils.label_replacing 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
- pm4py.objects.process_tree.utils.label_replacing.apply(process_tree: ProcessTree, string_dictio: Dict[str, str], rec_depth=0, parameters: Dict[Any, Any] | None = None) ProcessTree[source]#
Replaces the labels in the given process tree using the provided dictionary.
Parameters#
- process_tree
Process tree
- string_dictio
Correspondence dictionary (old labels -> new labels)
Returns#
- revised_tree
Revised process tree
pm4py.objects.process_tree.utils.regex 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
- pm4py.objects.process_tree.utils.regex.pt_to_regex(tree, rec_depth=0, shared_obj=None, parameters=None)[source]#
Transforms a process tree to a regular expression
NB: The conversion is not yet working with trees containing an AND and/or an OR operator!
Parameters#
- tree
Process tree
- parameters
Possible parameters of the algorithm
pm4py.objects.process_tree.utils.struct_similarity 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
- pm4py.objects.process_tree.utils.struct_similarity.features_from_process_tree(tree: ProcessTree) ndarray[source]#
Parameters#
tree : pm4py.objects.process_tree.obj.ProcessTree
Returns#
- numpy.ndarray (len = 10)
Components in the order defined by FEATURES.
- pm4py.objects.process_tree.utils.struct_similarity.structural_distance(tree1: ProcessTree, tree2: ProcessTree, weights: Dict[str, float] = None) float[source]#
Euclidean distance of the normalised feature vectors. weights lets you emphasise certain dimensions (defaults = 1).
- pm4py.objects.process_tree.utils.struct_similarity.structural_similarity(tree1: ProcessTree, tree2: ProcessTree, weights: Dict[str, float] = None) float[source]#
Computes the structural similarity between two process trees, following an approach similar to: Dijkman, Remco, et al. “Similarity of business process models: Metrics and evaluation.” Information Systems 36.2 (2011): 498-516.
Parameters#
- tree1
First process tree
- tree2
Second process tree
- weights
Weights of each feature
Returns#
- sim_metric
Similarity metric