pm4py.conformance.conformance_log_skeleton#
- pm4py.conformance.conformance_log_skeleton(log: EventLog | DataFrame, log_skeleton: Dict[str, Any], activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name', return_diagnostics_dataframe: bool = False) List[Set[Any]] [source]#
Perform conformance checking using the log skeleton.
Reference paper: Verbeek, H. M. W., and R. Medeiros de Carvalho. “Log skeletons: A classification approach to process discovery.” arXiv preprint arXiv:1806.08247 (2018).
A log skeleton is a declarative model consisting of six different constraints: - directly_follows: Specifies strict bounds on activities directly following each other. For example, ‘A should be directly followed by B’ and ‘B should be directly followed by C’. - always_before: Specifies that certain activities may only be executed if some other activities have been executed earlier in the case history. For example, ‘C should always be preceded by A’. - always_after: Specifies that certain activities should always trigger the execution of other activities in the future history of the case. For example, ‘A should always be followed by C’. - equivalence: Specifies that pairs of activities should occur the same number of times within a case. For example, ‘B and C should always happen the same number of times’. - never_together: Specifies that certain pairs of activities should never occur together in the case history. For example, ‘No case should contain both C and D’. - activ_occurrences: Specifies the allowed number of occurrences per activity. For example, ‘A is allowed to be executed 1 or 2 times, and B is allowed to be executed 1 to 4 times’.
- Parameters:
log – Log object.
log_skeleton – Log skeleton object, expressed as dictionaries of the six constraints along with the discovered rules.
activity_key (
str
) – Attribute to be used for the activity (default is “concept:name”).timestamp_key (
str
) – Attribute to be used for the timestamp (default is “time:timestamp”).case_id_key (
str
) – Attribute to be used as the case identifier (default is “case:concept:name”).return_diagnostics_dataframe (
bool
) – If possible, returns a dataframe with the diagnostics instead of the usual output (default is constants.DEFAULT_RETURN_DIAGNOSTICS_DATAFRAME).
- Returns:
A list of sets containing deviations for each case.
- Return type:
List[Set[Any]]
- Example:
-
- log_skeleton = pm4py.discover_log_skeleton(
dataframe, noise_threshold=0.1, activity_key=’concept:name’, case_id_key=’case:concept:name’, timestamp_key=’time:timestamp’
) conformance_lsk = pm4py.conformance_log_skeleton(
dataframe, log_skeleton, activity_key=’concept:name’, case_id_key=’case:concept:name’, timestamp_key=’time:timestamp’