pm4py.ml.extract_outcome_enriched_dataframe#

pm4py.ml.extract_outcome_enriched_dataframe(log: EventLog | DataFrame, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name', start_timestamp_key: str = 'time:timestamp') DataFrame[source]#

Enriches a dataframe with additional outcome-related columns computed from the entire case.

This function adds columns that model the outcome of each case by computing metrics such as arrival rates and service waiting times.

Parameters:
  • log – The event log or Pandas DataFrame to be enriched.

  • activity_key (str) – Attribute to be used for the activity.

  • timestamp_key (str) – Attribute to be used for the timestamp.

  • case_id_key (str) – Attribute to be used as the case identifier.

  • start_timestamp_key (str) – Attribute to be used as the start timestamp.

Returns:

An enriched Pandas DataFrame with additional outcome-related columns.

Return type:

pd.DataFrame

import pm4py

enriched_df = pm4py.extract_outcome_enriched_dataframe(
    log,
    activity_key='concept:name',
    timestamp_key='time:timestamp',
    case_id_key='case:concept:name',
    start_timestamp_key='time:timestamp'
)