Skip to content

Commit

Permalink
fix(pm4py): fixed hardcoded parameter in feature extraction interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti committed Mar 25, 2022
1 parent d8797f5 commit f4f5a0e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Parameters(Enum):
ENABLE_FIRST_LAST_ACTIVITY_INDEX = "enable_first_last_activity_index"
ENABLE_MAX_CONCURRENT_EVENTS = "enable_max_concurrent_events"
ENABLE_MAX_CONCURRENT_EVENTS_PER_ACTIVITY = "enable_max_concurrent_events_per_activity"
CASE_ATTRIBUTE_PREFIX = constants.CASE_ATTRIBUTE_PREFIX


def max_concurrent_events(log: EventLog, parameters: Optional[Dict[Union[str, Parameters], Any]] = None) -> Tuple[Any, List[str]]:
Expand Down Expand Up @@ -1140,8 +1141,10 @@ def apply(log: EventLog, parameters: Optional[Dict[Union[str, Parameters], Any]]
num_ev_attr = []

if type(log) is pd.DataFrame:
case_attribute_prefix = exec_utils.get_param_value(Parameters.CASE_ATTRIBUTE_PREFIX, parameters, "case:")

if str_tr_attr or num_tr_attr or str_ev_attr or num_ev_attr:
columns = list(set(["case:" + x for x in str_tr_attr]).union(set(["case:" + x for x in num_tr_attr])).union(
columns = list(set([case_attribute_prefix + x for x in str_tr_attr]).union(set([case_attribute_prefix + x for x in num_tr_attr])).union(
set(str_ev_attr)).union(set(num_ev_attr)))
fea_df = dataframe_utils.get_features_df(log, columns, parameters=parameters)
feature_names = list(fea_df.columns)
Expand Down

0 comments on commit f4f5a0e

Please sign in to comment.