pm4py.algo.transformation.ocel.features.objects.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.transformation.ocel.features.objects.algorithm.Parameters(*values)[source]#
Bases:
Enum- DEBUG = 'debug'#
- ENABLE_ALL = 'enable_all'#
- ENABLE_LIFECYCLE_METRICS = 'enable_lifecycle_metrics'#
- ENABLE_OBJECT_LIFECYCLE_LENGTH = 'enable_object_lifecycle_length'#
- ENABLE_OBJECT_LIFECYCLE_UNQ_ACT = 'enable_object_lifecycle_unq_act'#
- ENABLE_OBJECT_LIFECYCLE_DURATION = 'enable_object_lifecycle_duration'#
- ENABLE_OBJECT_DEGREE_CENTRALITY = 'enable_object_degree_centrality'#
- ENABLE_OBJECT_GENERAL_INTERACTION_GRAPH = 'enable_object_general_interaction_graph'#
- ENABLE_OBJECT_GENERAL_DESCENDANTS_GRAPH = 'enable_object_general_descendants_graph'#
- ENABLE_OBJECT_GENERAL_INHERITANCE_GRAPH = 'enable_object_general_inheritance_graph'#
- ENABLE_OBJECT_COBIRTH_GRAPH = 'enable_object_cobirth_graph'#
- ENABLE_OBJECT_CODEATH_GRAPH = 'enable_object_codeath_graph'#
- ENABLE_OBJECT_LIFECYCLE_ACTIVITIES = 'enable_object_lifecycle_activities'#
- ENABLE_OBJECT_LIFECYCLE_PATHS = 'enable_object_lifecycle_paths'#
- ENABLE_OBJECT_STR_ATTRIBUTES = 'enable_object_str_attributes'#
- ENABLE_OBJECT_NUM_ATTRIBUTES = 'enable_object_num_attributes'#
- ENABLE_OBJECT_INTERACTION_GRAPH_OT = 'enable_object_interaction_graph_ot'#
- ENABLE_OBJECT_WORK_IN_PROGRESS = 'enable_object_work_in_progress'#
- ENABLE_RELATED_EVENTS_FEATURES = 'enable_related_events_features'#
- ENABLE_RELATED_ACTIVITIES_FEATURES = 'enable_related_activities_features'#
- ENABLE_OBJ_CON_IN_GRAPH_FEATURES = 'enable_obj_con_in_graph_features'#
- FILTER_PER_TYPE = 'filter_per_type'#
- pm4py.algo.transformation.ocel.features.objects.algorithm.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#
Extract a feature table related to the objects of an OCEL.
Implements the approach described in: Berti, A., Herforth, J., Qafari, M.S. et al. Graph-based feature extraction on object-centric event logs. Int J Data Sci Anal (2023). https://doi.org/10.1007/s41060-023-00428-2
- Parameters:
ocel – OCEL
parameters – Parameters of the algorithm, including:
Parameters.ENABLE_ALL => enable the extraction of all the belowmentioned features
Parameters.ENABLE_LIFECYCLE_METRICS => enables the computation of the lifecycle metrics
Parameters.ENABLE_OBJECT_LIFECYCLE_LENGTH => enables the object lifecycle length feature
Parameters.ENABLE_OBJECT_LIFECYCLE_DURATION => enables the object lifecycle duration feature
Parameters.ENABLE_OBJECT_LIFECYCLE_UNQ_ACT => enables the object lifecycle unique activities feature
Parameters.ENABLE_OBJECT_DEGREE_CENTRALITY => enables the object degree centrality feature
Parameters.ENABLE_OBJECT_GENERAL_INTERACTION_GRAPH => enables the object general interaction graph feature
Parameters.ENABLE_OBJECT_GENERAL_DESCENDANTS_GRAPH => enables the object general descendants graph feature
Parameters.ENABLE_OBJECT_GENERAL_INHERITANCE_GRAPH => enables the object general inheritance graph feature
Parameters.ENABLE_OBJECT_COBIRTH_GRAPH => enables the object cobirth graph feature
Parameters.ENABLE_OBJECT_CODEATH_GRAPH => enables the object codeath graph feature
Parameters.ENABLE_OBJECT_LIFECYCLE_ACTIVITIES => enables the features associated to the activities in the lifecycle of an object
Parameters.ENABLE_OBJECT_STR_ATTRIBUTES => enables the one-hot-encoding of a specified collection of string attributes for each object.
Parameters.ENABLE_OBJECT_NUM_ATTRIBUTES => enables the extraction of a specified collection of numeric attributes for each object.
Parameters.ENABLE_OBJECT_INTERACTION_GRAPH_OT => enables the extraction of the number of interacting objects per object type.
Parameters.FILTER_PER_TYPE => once obtained, filter only the objects that belongs to a specific type
Parameters.ENABLE_RELATED_EVENTS_FEATURES => enables the extraction of features for the related events to a given object.
Parameters.ENABLE_RELATED_ACTIVITIES_FEATURES => enables the extraction of features for the last occurrence of an activity in the events related to the object.
Parameters.ENABLE_OBJ_CON_IN_GRAPH_FEATURES => enables the extraction of features from the neighboring objects.
Parameters.ENABLE_OBJECT_LIFECYCLE_PATHS => enables the features associated to the paths in the lifecycle of an object
- Returns:
data – Values of the features
feature_names – Names of the features
- pm4py.algo.transformation.ocel.features.objects.algorithm.transform_features_to_dict_dict(ocel: OCEL, data: List[List[float]], feature_names: List[str], parameters=None)[source]#
Transforms object-based features expressed in the conventional way to a dictionary where the key is the object ID, the second key is the feature name and the value is the feature value.
- Parameters:
ocel – Object-centric event log
data – Values of the features
feature_names – Names of the features
- Returns:
Dictionary associating an ID to a dictionary of features
- Return type:
dict_dict