pm4py.objects.conversion.log.variants.to_nx module#
- class pm4py.objects.conversion.log.variants.to_nx.Parameters(*values)[source]#
Bases:
Enum- INCLUDE_DF = 'include_df'#
- CASE_ID_ATTRIBUTE = 'case_id_attribute'#
- OTHER_CASE_ATTRIBUTES_AS_NODES = 'other_case_attributes_as_nodes'#
- EVENT_ATTRIBUTES_AS_NODES = 'event_attributes_as_nodes'#
- pm4py.objects.conversion.log.variants.to_nx.apply(log_obj: EventLog | EventStream | DataFrame, parameters: Dict[Any, Any] | None = None)[source]#
Converts an event log object to a NetworkX DiGraph object. The nodes of the graph are the events, the cases (and possibly the attributes of the log). The edges are: - Connecting each event to the corresponding case (BELONGS_TO type) - Connecting every event to the directly-following one (DF type, if enabled) - Connecting every case/event to the given attribute values (ATTRIBUTE_EDGE type)
- Parameters:
log_obj – Log object (EventLog, EventStream, Pandas dataframe)
parameters – Parameters of the conversion, including: - Parameters.INCLUDE_DF => include the directly-follows graph relation in the graph - Parameters.CASE_ID_ATTRIBUTE => specify which attribute at the case level should be considered the case ID - Parameters.OTHER_CASE_ATTRIBUTES_AS_NODES => specify which attributes at the case level should be inserted in the graph as nodes (other than the caseID) (list, default empty) - Parameters.EVENT_ATTRIBUTES_AS_NODES => specify which attributes at the event level should be inserted in the graph as nodes (list, default empty)
- Returns:
NetworkX DiGraph object
- Return type:
nx_digraph