Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

discovery

Petri net discovery algorithms


Description

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

Usage

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)
}

pm4py

Interface to the 'PM4py' Process Mining Library

v1.2.7
GPL-3
Authors
Felix Mannhardt [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.