PM4PY discovery algorithms that discover a Petri net and its initial and final marking. Currently the Inductive Miner and the Alpha Miner are implemented.

discovery_inductive(
  eventlog,
  parameters = default_parameters(eventlog),
  variant = variant_inductive_imdfb(),
  convert = TRUE
)

variant_inductive_imdfb()

variant_inductive_only_dfg()

discovery_alpha(
  eventlog,
  parameters = default_parameters(eventlog),
  variant = variant_alpha_classic(),
  convert = TRUE
)

variant_alpha_classic()

variant_alpha_plus()

Arguments

eventlog

A bupaR event log or an R data frame.

parameters

A named list of PM4PY parameters (see parameters) as required by the discovery method. By default, if the eventlog is a bupaR event log, the activity_key, timestamp_key, and caseid_key are automatically determined.

variant

The variant of the discovery algorithm to be used. For Inductive Miner currently only variant_inductive_imdfb is supported.

convert

TRUE to automatically convert Python objects to their R equivalent. If you pass FALSE you can do manual conversion using the r-py-conversion function.

Value

A named list with elements petrinet, initial_marking, and final_marking or the original Python object.

Examples

if (pm4py_available()) { library(eventdataR) data(patients) # As Inductive Miner of PM4PY is not life-cycle aware, keep only `complete` events: patients_completes <- patients[patients$registration_type == "complete", ] net <- discovery_inductive(patients_completes) # Show details of the obtained bupaR Petri net print(net$petrinet) # initial marking is a character vector print(net$initial_marking) # final marking is a character vector print(net$final_marking) # Petri net can be used with other bupaR functions petrinetR::render_PN(net$petrinet) # Keep an unconverted PM4PY Petri net for use in other PM4PY functions py_net <- discovery_inductive(patients_completes, convert = FALSE) }
#> Marking: source #> Enabled transition #> id label enabled #> 1 bb26d095-9b68-4922-a31a-aa5f3fb87169 Registration TRUE #> [1] "source" #> [1] "sink"