pm4py.algo.discovery.alpha.variants package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

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

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.discovery.alpha.variants.classic.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
pm4py.algo.discovery.alpha.variants.classic.apply(log: EventLog, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, 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#

pm4py.algo.discovery.alpha.variants.classic.apply_dfg(dfg: Dict[Tuple[str, str], int], parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, 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#

netpm4py.entities.petri.petrinet.PetriNet

A Petri net describing the event log that is provided as an input

initial markingpm4py.models.net.Marking

marking object representing the initial marking

final markingpm4py.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: None | Dict[str, int], end_activities: None | Dict[str, int], parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, 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#

netpm4py.entities.petri.petrinet.PetriNet

A Petri net describing the event log that is provided as an input

initial markingpm4py.models.net.Marking

marking object representing the initial marking

final markingpm4py.models.net.Marking

marking object representing the final marking, not guaranteed that it is actually reachable!

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

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.discovery.alpha.variants.plus.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
REMOVE_UNCONNECTED = 'remove_unconnected'#
pm4py.algo.discovery.alpha.variants.plus.preprocessing(log: EventLog, parameters: Dict[str | Parameters, Any] | None = 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.get_relations(log: 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.processing(log: 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.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#

bool

Boolean (sharp relation holds?)

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#

bool

Boolean (sharp relation holds?)

pm4py.algo.discovery.alpha.variants.plus.postprocessing(net: PetriNet, initial_marking: Marking, final_marking: Marking, A, B, pairs, loop_one_list) Tuple[PetriNet, Marking, 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.apply(trace_log: EventLog, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, 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.add_source(net, start_activities, label_transition_dict)[source]#

Adding source pe

pm4py.algo.discovery.alpha.variants.plus.add_sink(net, end_activities, label_transition_dict)[source]#

Adding sink pe

pm4py.algo.discovery.alpha.variants.plus.remove_initial_hidden_if_possible(net: PetriNet, im: 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_final_hidden_if_possible(net: PetriNet, fm: Marking)[source]#

Remove final hidden transition if possible

Parameters#

net

Petri net

fm

Final marking

Returns#

net

Petri net

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

Remove unconnected transitions if any

Parameters#

net

Petri net

Returns#

net

Petri net without unconnected transitions