pm4py.conformance.optimal_alignment_dcr#
- pm4py.conformance.optimal_alignment_dcr(log: EventLog | DataFrame | Trace, dcr_graph: DcrGraph, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name', return_diagnostics_dataframe: bool = False) DataFrame | Any [source]#
Applies optimal alignment against a DCR model. Reference paper: Axel Kjeld Fjelrad Christfort & Tijs Slaats. “Efficient Optimal Alignment Between Dynamic Condition Response Graphs and Traces” https://doi.org/10.1007/978-3-031-41620-0_1 Parameters ———- log : EventLog | pd.DataFrame | Trace
Event log to be used for alignment. also supports Trace
- dcr_graphDCRGraph
The DCR graph against which the log is aligned.
- activity_keystr
The key to identify activity names in the log.
- timestamp_keystr
The key to identify timestamps in the log.
- case_id_keystr
The key to identify case identifiers in the log.
- return_diagnostics_dataframebool, default False
If True, returns a diagnostics dataframe instead of the usual list output.
Returns#
- Union[pd.DataFrame, List[Tuple[str, Dict[str, Any]]]]
Depending on the value of return_diagnostics_dataframe, returns either a pandas DataFrame with diagnostics or a list of alignment results.
Raises#
- Exception
If the log provided is not an instance of EventLog or pandas DataFrame.
Examples#