Skip to main content
Rust4PM

precision

process_mining::conformance::case_centric::precision

Functions in this Module(3)

escaping_edges_precision

conformance::case_centric::precisionSource

Escaping-edges precision of net with respect to log

See the module documentation for the measure and EscapingEdgesOptions for the variants.

With LogPaths::Aligned, first reports the progress of align_variants (stage "Aligning variants", then "Retrying variants with more memory" if retrying) to a Control. Then reports progress with stage "Measuring escaping edges", one unit per variant. Emits no partial results.

Arguments
Import from .json, .pnml, .apnml
Import from .json, .xes, .xes.gz, or pass EventLog (converted automatically)

Options for [`escaping_edges_precision`]

EscapingEdgesPrecision

Result of [`escaping_edges_precision`]

import r4pm

log = r4pm.import_item("EventLog", "data/road-traffic-fines.xes.gz")
net = r4pm.bindings.discover_inductive_net(log)

# Aligns the variants and counts the escaping edges along their paths through the model.
precision = r4pm.bindings.escaping_edges_precision(net, log)
print(f"precision {precision['precision']:.3f}")

# The variants of the measure in ProM and pm4py
for preset in ["prom", "pm4py"]:
    options = r4pm.bindings.escaping_edges_options(preset)
    result = r4pm.bindings.escaping_edges_precision(net, log, options)
    print(f"precision ({preset}) {result['precision']:.3f}")

escaping_edges_precision_from_alignments

conformance::case_centric::precisionSource

Escaping-edges precision of net with respect to the log behind alignments

Reuses alignments computed for net (e.g., for fitness). Requires LogPaths::Aligned, whose fields are then not used.

Fails with PrecisionError::NoTraceAligned if there are traces, but none of them was aligned (e.g., because the final marking is unreachable).

Reports progress to a Control with stage "Measuring escaping edges", one unit per variant. Emits no partial results.

Arguments
Import from .json, .pnml, .apnml

Options for [`escaping_edges_precision`]

EscapingEdgesPrecision

Result of [`escaping_edges_precision`]

import r4pm

log = r4pm.import_item("EventLog", "data/road-traffic-fines.xes.gz")
net = r4pm.bindings.discover_inductive_net(log)

# Align once, then reuse the alignments for fitness and precision.
alignments = r4pm.bindings.align_variants(net, log)
fitness = r4pm.bindings.compute_fitness(net, alignments)
precision = r4pm.bindings.escaping_edges_precision_from_alignments(net, alignments)

print(f"fitness {fitness['log_fitness']:.3f}, precision {precision['precision']:.3f}")