Skip to content

Commit

Permalink
FT 1253 Raw values for performance DFG calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
fit-alessandro-berti authored and fit-sebastiaan-van-zelst committed Oct 1, 2021
1 parent 5a1c247 commit e1b202e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pm4py/algo/discovery/dfg/adapters/pandas/df_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def get_dfg_graph(df, measure="frequency", activity_key="concept:name", case_id_
dfg_performance = {}
for key in dfg_performance_mean:
dfg_performance[key] = {"mean": dfg_performance_mean[key], "median": dfg_performance_median[key], "max": dfg_performance_max[key], "min": dfg_performance_min[key], "sum": dfg_performance_sum[key], "stdev": dfg_performance_std[key]}
elif perf_aggregation_key == "raw_values":
dfg_performance = directly_follows_grouping.apply(list).to_dict()
else:
dfg_performance = directly_follows_grouping.agg(perf_aggregation_key).to_dict()

Expand Down
2 changes: 2 additions & 0 deletions pm4py/algo/discovery/dfg/variants/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def performance(log: Union[EventLog, EventStream], parameters: Optional[Dict[Uni
ret[key] = stdev(ret0[key]) if len(ret0[key]) > 1 else 0
elif aggregation_measure == "sum":
ret[key] = sum(ret0[key])
elif aggregation_measure == "raw_values":
ret[key] = ret0[key]
elif aggregation_measure == "all":
ret[key] = {"median": median(ret0[key]), "min": min(ret0[key]), "max": max(ret0[key]),
"stdev": stdev(ret0[key]) if len(ret0[key]) > 1 else 0, "sum": sum(ret0[key]), "mean": mean(ret0[key])}
Expand Down

0 comments on commit e1b202e

Please sign in to comment.