pm4py.org.discover_organizational_roles#

pm4py.org.discover_organizational_roles(log: EventLog | DataFrame, activity_key: str = 'concept:name', resource_key: str = 'org:resource', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') List[Role][source]#

Mines the organizational roles.

A role is a set of activities in the log that are executed by a similar (multi)set of resources. Hence, it is a specific function within the organization. Grouping the activities into roles can help:

Reference paper: Burattin, Andrea, Alessandro Sperduti, and Marco Veluscek. “Business models enhancement through discovery of roles.” 2013 IEEE Symposium on Computational Intelligence and Data Mining (CIDM). IEEE, 2013.

Parameters:
  • log – Event log or Pandas DataFrame.

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

  • resource_key (str) – Attribute to be used for the resource.

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

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

import pm4py

roles = pm4py.discover_organizational_roles(
    dataframe,
    resource_key='org:resource',
    activity_key='concept:name',
    timestamp_key='time:timestamp',
    case_id_key='case:concept:name'
)