pm4py.discovery.discover_transition_system#
- pm4py.discovery.discover_transition_system(log: EventLog | DataFrame, direction: str = 'forward', window: int = 2, view: str = 'sequence', activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') TransitionSystem [source]#
Discovers a Transition System from a log.
The Transition System is built based on the specified direction, window size, and view. It captures the transitions between states of activity sequences.
- Parameters:
log – Event log or Pandas DataFrame.
direction (
str
) – Direction in which the transition system is built (“forward” or “backward”) (default: “forward”).window (
int
) – Window size for state construction (e.g., 2, 3) (default: 2).view (
str
) – View to use in the construction of the states (“sequence”, “set”, “multiset”) (default: “sequence”).activity_key (
str
) – Attribute to be used for the activity (default: “concept:name”).timestamp_key (
str
) – Attribute to be used for the timestamp (default: “time:timestamp”).case_id_key (
str
) – Attribute to be used as case identifier (default: “case:concept:name”).
- Returns:
A TransitionSystem object representing the discovered transition system.
- Return type:
TransitionSystem
import pm4py transition_system = pm4py.discover_transition_system( dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp' )