Skip to content

Commit

Permalink
fix extraction of users
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Feb 27, 2024
1 parent 1141782 commit 066478a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions discovery/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pm4py
import json

def discover_petri_net(event_log,algorithm="inductive"):
"""
Expand Down Expand Up @@ -84,6 +85,9 @@ def bot_statistics(event_log):
stats['numberOfStates'] = event_log['concept:name'].nunique()
if 'user' in event_log.columns:
stats['numberOfUsers'] = event_log['user'].nunique()
else:
users = event_log['REMAKRS'].apply(lambda x: json.loads(x)['user'])
stats['numberOfUsers'] = users.nunique()
stats['averageConversationLength'] = event_log.groupby(
'case:concept:name').size().mean()
stats['averageConversationDuration'] = event_log.groupby(
Expand Down

0 comments on commit 066478a

Please sign in to comment.