pm4py.ml.extract_ocel_features#
- pm4py.ml.extract_ocel_features(ocel: OCEL, obj_type: str, enable_object_lifecycle_paths: bool = True, enable_object_work_in_progress: bool = False, object_str_attributes: Collection[str] | None = None, object_num_attributes: Collection[str] | None = None, include_obj_id: bool = False, debug: bool = False) DataFrame [source]#
Extracts from an object-centric event log a set of features (returned as dataframe) computed on the OCEL for the objects of a given object type.
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
) – object-centric event logobj_type (
str
) – object type that should be consideredenable_object_lifecycle_paths (
bool
) – enables the “lifecycle paths” featureenable_object_work_in_progress (
bool
) – enables the “work in progress” feature (which has an high computational cost)object_str_attributes – string attributes at the object level to one-hot encode during the feature extraction
object_num_attributes – numeric attributes at the object level to one-hot encode during the feature extraction
include_obj_id (
bool
) – includes the object identifier as column of the “features” dataframedebug (
bool
) – enables debugging mode (telling at which point of the feature extraction you are)
- Return type:
pd.DataFrame
import pm4py ocel = pm4py.read_ocel('log.jsonocel') fea_df = pm4py.extract_ocel_features(ocel, "item")