Heuristics Miner

Heuristics Miner

Heuristics Miner is an algorithm that acts on the Directly-Follows Graph, providing way to handle with noise and to find common constructs (dependency between two activities, AND). The output of the Heuristics Miner is an Heuristics Net, so an object that contains the activities and the relationships between them. The Heuristics Net can be then converted into a Petri net.

The original paper regarding Heuristics Miner can be read following the link:

Weijters, A. J. M. M., Wil MP van Der Aalst, and AK Alves De Medeiros.
“Process mining with the heuristics miner-algorithm.”
Technische Universiteit Eindhoven, Tech. Rep. WP 166 (2006): 1-34.

Applying the Heuristics Miner to discover an Heuristics Net

First, a log can be imported

from pm4py.objects.log.importer.xes import factory as xes_importer
import os
log_path = os.path.join("tests", "compressed_input_data", "09_a32f0n00.xes.gz")
log = xes_importer.apply(log_path)

Then, an Heuristics Net could be found through the command:

from pm4py.algo.discovery.heuristics import factory as heuristics_miner
heu_net = heuristics_miner.apply_heu(log, parameters={"dependency_thresh": 0.99})

Possible parameters of the Heuristics Miner:

  • dependency_thresh: dependency threshold of the Heuristics Miner (default: 0.5)
  • and_measure_thresh: AND measure threshold of the Heuristics Miner (default: 0.65)
  • min_act_count: minimum number of occurrences of an activity to be considered (default: 1)
  • min_dfg_occurrences: minimum number of occurrences of an edge to be considered (default: 1)
  • dfg_pre_cleaning_noise_thresh: cleaning threshold of the DFG (in order to remove weaker edges, default 0.05)

The Heuristics Net can be therefore viewed through:

from pm4py.visualization.heuristics_net import factory as hn_vis_factory
gviz = hn_vis_factory.apply(heu_net)
hn_vis_factory.view(gviz)

Obtaining a Petri net

The following instructions could be used to apply the Heuristics Miner and get a Petri net out of it:

from pm4py.algo.discovery.heuristics import factory as heuristics_miner
net, im, fm = heuristics_miner.apply(log, parameters={"dependency_thresh": 0.99})

Then, the Petri net can be visualized:

from pm4py.visualization.petrinet import factory as pn_vis_factory
gviz = pn_vis_factory.apply(net, im, fm)
pn_vis_factory.view(gviz)

.