pm4py.algo.discovery.alpha.variants package

Submodules

pm4py.algo.discovery.alpha.variants.classic module

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.discovery.alpha.variants.classic.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.algo.discovery.alpha.variants.classic.apply(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Union[str, pm4py.algo.discovery.alpha.variants.classic.Parameters], Any]] = None) Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

This method calls the “classic” alpha miner 1.

Parameters
  • log (pm4py.log.log.EventLog) – Event log to use in the alpha miner

  • parameters

    Parameters of the algorithm, including:
    activity_keystr, optional

    Key to use within events to identify the underlying activity. By deafult, the value ‘concept:name’ is used.

Returns

  • net (pm4py.entities.petri.petrinet.PetriNet) – A Petri net describing the event log that is provided as an input

  • initial marking (pm4py.models.net.Marking) – marking object representing the initial marking

  • final marking (pm4py.models.net.Marking) – marking object representing the final marking, not guaranteed that it is actually reachable!

References

1

Wil M. P. van der Aalst et al., “Workflow Mining: Discovering Process Models from Event Logs”, IEEE Trans. Knowl. Data Eng., 16, 1128-1142, 2004. DOI.

pm4py.algo.discovery.alpha.variants.classic.apply_dfg(dfg: Dict[Tuple[str, str], int], parameters: Optional[Dict[Union[str, pm4py.algo.discovery.alpha.variants.classic.Parameters], Any]] = None) Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Applying Alpha Miner starting from the knowledge of the Directly Follows graph, and of the start activities and end activities in the log inferred from the DFG

Parameters
  • dfg – Directly-Follows graph

  • parameters

    Parameters of the algorithm including:

    activity key -> name of the attribute that contains the activity

Returns

  • net (pm4py.entities.petri.petrinet.PetriNet) – A Petri net describing the event log that is provided as an input

  • initial marking (pm4py.models.net.Marking) – marking object representing the initial marking

  • final marking (pm4py.models.net.Marking) – marking object representing the final marking, not guaranteed that it is actually reachable!

pm4py.algo.discovery.alpha.variants.classic.apply_dfg_sa_ea(dfg: Dict[str, int], start_activities: Union[None, Dict[str, int]], end_activities: Union[None, Dict[str, int]], parameters: Optional[Dict[Union[str, pm4py.algo.discovery.alpha.variants.classic.Parameters], Any]] = None) Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Applying Alpha Miner starting from the knowledge of the Directly Follows graph, and of the start activities and end activities in the log (possibly inferred from the DFG)

Parameters
  • dfg – Directly-Follows graph

  • start_activities – Start activities

  • end_activities – End activities

  • parameters

    Parameters of the algorithm including:

    activity key -> name of the attribute that contains the activity

Returns

  • net (pm4py.entities.petri.petrinet.PetriNet) – A Petri net describing the event log that is provided as an input

  • initial marking (pm4py.models.net.Marking) – marking object representing the initial marking

  • final marking (pm4py.models.net.Marking) – marking object representing the final marking, not guaranteed that it is actually reachable!

pm4py.algo.discovery.alpha.variants.plus module

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.discovery.alpha.variants.plus.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
REMOVE_UNCONNECTED = 'remove_unconnected'
pm4py.algo.discovery.alpha.variants.plus.add_sink(net, end_activities, label_transition_dict)[source]

Adding sink pe

pm4py.algo.discovery.alpha.variants.plus.add_source(net, start_activities, label_transition_dict)[source]

Adding source pe

pm4py.algo.discovery.alpha.variants.plus.apply(trace_log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Union[str, pm4py.algo.discovery.alpha.variants.plus.Parameters], Any]] = None) Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Apply the Alpha Algorithm to a given log

Parameters
  • trace_log – Log

  • parameters – Possible parameters of the algorithm

Returns

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.alpha.variants.plus.get_relations(log: pm4py.objects.log.obj.EventLog)[source]

Applying the classic Alpha Algorithm

Parameters

log – Filtered log

Returns

  • causal – Causal relations

  • parallel – Parallel relations

  • follows – Follows relations

pm4py.algo.discovery.alpha.variants.plus.get_sharp_relation(follows, instance_one, instance_two)[source]

Returns true if sharp relations holds

Parameters
  • follows – Follows relations

  • instance_one – Instance one

  • instance_two – Instance two

Returns

Boolean (sharp relation holds?)

Return type

bool

pm4py.algo.discovery.alpha.variants.plus.get_sharp_relations_for_sets(follows, set_1, set_2)[source]

Returns sharp relations for sets

Parameters
  • follows – Follows relations

  • set_1 – First set to consider

  • set_2 – Second set to consider

Returns

Boolean (sharp relation holds?)

Return type

bool

pm4py.algo.discovery.alpha.variants.plus.postprocessing(net: pm4py.objects.petri_net.obj.PetriNet, initial_marking: pm4py.objects.petri_net.obj.Marking, final_marking: pm4py.objects.petri_net.obj.Marking, A, B, pairs, loop_one_list) Tuple[pm4py.objects.petri_net.obj.PetriNet, pm4py.objects.petri_net.obj.Marking, pm4py.objects.petri_net.obj.Marking][source]

Adding the filtered transitions to the Petri net

Parameters
  • loop_list – List of looped activities

  • classical_alpha_result – Result after applying the classic alpha algorithm to the filtered log

  • A – See Paper for definition

  • B – See Paper for definition

Returns

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.alpha.variants.plus.preprocessing(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Union[str, pm4py.algo.discovery.alpha.variants.plus.Parameters], Any]] = None) Any[source]

Preprocessing step for the Aplha+ algorithm. Removing all transitions from the log with a loop of length one.

Parameters
  • log – Event log

  • parameters – Parameters of the algorithm

Returns

  • log – filtered log and a list of the filtered transitions

  • loop_one_list – Loop one list

  • A_filtered – Dictionary: activity before the loop-length-one activity

  • B_filtered – Dictionary: activity after the loop-length-one activity

  • loops_in_first_place – Loops in source place

  • loops_in_last_place – Loops in sink place

pm4py.algo.discovery.alpha.variants.plus.processing(log: pm4py.objects.log.obj.EventLog, causal: Tuple[str, str], follows: Tuple[str, str])[source]

Applying the Alpha Miner with the new relations

Parameters
  • log – Filtered log

  • causal – Pairs that have a causal relation (->)

  • follows – Pairs that have a follow relation (>)

Returns

  • net – Petri net

  • im – Initial marking

  • fm – Final marking

pm4py.algo.discovery.alpha.variants.plus.remove_final_hidden_if_possible(net: pm4py.objects.petri_net.obj.PetriNet, fm: pm4py.objects.petri_net.obj.Marking)[source]

Remove final hidden transition if possible

Parameters
  • net – Petri net

  • fm – Final marking

Returns

Petri net

Return type

net

pm4py.algo.discovery.alpha.variants.plus.remove_initial_hidden_if_possible(net: pm4py.objects.petri_net.obj.PetriNet, im: pm4py.objects.petri_net.obj.Marking)[source]

Remove initial hidden transition if possible

Parameters
  • net – Petri net

  • im – Initial marking

Returns

  • net – Petri net

  • im – Possibly different initial marking

pm4py.algo.discovery.alpha.variants.plus.remove_unconnected_transitions(net: pm4py.objects.petri_net.obj.PetriNet)[source]

Remove unconnected transitions if any

Parameters

net – Petri net

Returns

Petri net without unconnected transitions

Return type

net

Module contents

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.