pm4py.algo.organizational_mining.roles.common.algorithm module#
PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH
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.organizational_mining.roles.common.algorithm.Parameters(*values)[source]#
Bases:
Enum- ROLES_THRESHOLD_PARAMETER = 'roles_threshold_parameter'#
- RESOURCE_KEY = 'pm4py:param:resource_key'#
- ACTIVITY_KEY = 'pm4py:param:activity_key'#
- pm4py.algo.organizational_mining.roles.common.algorithm.get_sum_from_dictio_values(dictio, parameters=None)[source]#
Get the sum of a dictionary values
- Parameters:
dictio – Dictionary
parameters – Parameters of the algorithm
- Returns:
Sum of the dictionary values
- Return type:
sum_values
- pm4py.algo.organizational_mining.roles.common.algorithm.normalize_role(role, parameters=None)[source]#
Normalize a role
- Parameters:
role – Originators of the role
parameters – Parameters of the algorithm
- Returns:
Normalized multiset of originators
- Return type:
normalized_role
- pm4py.algo.organizational_mining.roles.common.algorithm.find_multiset_intersection(role1, role2, normalize=False, parameters=None)[source]#
Finds the intersection of a multiset
- Parameters:
role1 – First role originators
role2 – Second role originators
normalize – Do the normalization of the roles
parameters – Parameters of the algorithm
- Returns:
Intersection of the multiset
- Return type:
intersection
- pm4py.algo.organizational_mining.roles.common.algorithm.find_multiset_union(role1, role2, normalize=False, parameters=None)[source]#
Finds the union of a multiset
- Parameters:
role1 – First role originators
role2 – Second role originators
normalize – Do the normalization of the roles
parameters – Parameters of the algorithm
- Returns:
Union of the multiset
- Return type:
union
- pm4py.algo.organizational_mining.roles.common.algorithm.find_role_similarity(roles, i, j, parameters=None)[source]#
Calculate a number of similarity between different roles
- Parameters:
roles – List of roles
i – Index of the first role
j – Index of the second role
parameters – Parameters of the algorithm
- Returns:
Similarity measure
- Return type:
similarity
- pm4py.algo.organizational_mining.roles.common.algorithm.aggregate_roles_iteration(roles, parameters=None)[source]#
Single iteration of the roles aggregation algorithm
- Parameters:
roles – Roles
parameters – Parameters of the algorithm
- Returns:
(Partially aggregated) roles
- Return type:
agg_roles
- pm4py.algo.organizational_mining.roles.common.algorithm.aggregate_roles_algorithm(roles, parameters=None)[source]#
Algorithm to aggregate similar roles
- Parameters:
roles – Roles
parameters – Parameters of the algorithm
- Returns:
(Aggregated) roles
- Return type:
agg_roles
- pm4py.algo.organizational_mining.roles.common.algorithm.get_initial_roles(res_act_couples, parameters=None)[source]#
Get the initial list of roles (each activity is a stand-alone role)
- Parameters:
res_act_couples – (resource, activity) couples along with the number of occurrences
parameters – Parameters of the algorithm
- Returns:
List of roles (set of activities + multiset of resources)
- Return type:
roles
- pm4py.algo.organizational_mining.roles.common.algorithm.apply(res_act_couples, parameters=None) List[Role][source]#
Apply the roles detection, introduced by Burattin, Andrea, Alessandro Sperduti, and Marco Veluscek. “Business models enhancement through discovery of roles.” 2013 IEEE Symposium on Computational Intelligence and Data Mining (CIDM). IEEE, 2013.
- Parameters:
res_act_couples – (resource, activity) couples along with the number of occurrences
parameters – Parameters of the algorithm
- Returns:
List of roles (set of activities + multiset of resources)
- Return type:
roles