pm4py.algo.transformation.ocel.features.events.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.events.algorithm.Parameters(*values)[source]#

Bases: Enum

ENABLE_ALL = 'enable_all'#
ENABLE_EVENT_ACTIVITY = 'enable_event_activity'#
ENABLE_EVENT_TIMESTAMP = 'enable_event_timestamp'#
ENABLE_EVENT_NUM_REL_OBJS = 'enable_event_num_rel_objs'#
ENABLE_EVENT_NUM_REL_OBJS_TYPE = 'enable_event_num_rel_objs_type'#
ENABLE_EVENT_STR_ATTRIBUTES = 'enable_event_str_attributes'#
ENABLE_EVENT_NUM_ATTRIBUTES = 'enable_event_num_attributes'#
ENABLE_EVENT_START_OT = 'enable_event_start_ot'#
ENABLE_EVENT_END_OT = 'enable_event_end_ot'#
ENABLE_NEW_INTERACTIONS = 'enable_new_interactions'#
pm4py.algo.transformation.ocel.features.events.algorithm.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

Extracts a feature table related to the events of an OCEL.

Parameters:
  • ocel – Object-centric event log

  • parameters – Parameters for extracting the feature table, including:

    • Parameters.ENABLE_ALL => enables all the belowmentioned features

    • Parameters.ENABLE_EVENT_ACTIVITY => enables the one-hot-encoding of the activities of the event

    • Parameters.ENABLE_EVENT_TIMESTAMP => enables the encoding of the timestamp of the event as feature

    • Parameters.ENABLE_EVENT_NUM_REL_OBJS => enables the “overall number of related objects” feature

    • Parameters.ENABLE_EVENT_NUM_REL_OBJS_TYPE => enables the “number of related objects per type” feature

    • Parameters.ENABLE_EVENT_STR_ATTRIBUTES => enables the one-hot-encoding of a given collection of string event attributes (specified inside the “str_ev_attr” parameter)

    • Parameters.ENABLE_EVENT_NUM_ATTRIBUTES => enables the extraction of a given collection of numeric event attributes in the feature table

    • Parameters.ENABLE_EVENT_START_OT => calculates some features which establish if the event starts the lifecycle of some objects of a type.

    • Parameters.ENABLE_EVENT_END_OT => calculates some features which establish if the event completes the lifecycle of some objects of a type.

    • Parameters.ENABLE_NEW_INTERACTIONS => number of new interactions between the related objects which appears in a given event.

    • Parameters.ENABLE_RELATED_OBJECTS_FEATURES => associates to the event some features calculated on the related objects.

Returns:

  • data – Values of the features

  • feature_names – Names of the features

pm4py.algo.transformation.ocel.features.events.algorithm.transform_features_to_dict_dict(ocel: OCEL, data: List[List[float]], feature_names: List[str], parameters=None)[source]#

Transforms event-based features expressed in the conventional way to a dictionary where the key is the event 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