pm4py.algo.discovery.genetic.variants.classic module#
PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH
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
- pm4py.algo.discovery.genetic.variants.classic.apply(log: EventLog | EventStream | DataFrame, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#
Discovers a Petri net using Genetic Miner
Reference paper: Maximilian Josef Frank. “Optimising and Implementing the Genetic Miner in PM4Py” (2026).
- Parameters:
log – Event log
parameters – Possible parameters of the algorithm, including:
Parameters.ACTIVITY_KEY
Parameters.TIMESTAMP_KEY
Parameters.CASE_ID_KEY
Parameters.POPULATION_SIZE
Parameters.ELITISM_RATE
Parameters.CROSSOVER_RATE
Parameters.MUTATION_RATE
Parameters.GENERATIONS
Parameters.ELITISM_MIN_SAMPLE
Parameters.LOG_CSV
- Returns:
net – Petri net
im – Initial marking
fm – Final marking
- pm4py.algo.discovery.genetic.variants.classic.individuals(log: DataFrame | EventLog, sample_size=1, T=None, keys: Dict[str, str] = {'activity_key': 'concept:name', 'case_id_key': 'case:concept:name', 'timestamp_key': 'time:timestamp'}) List[Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]]][source]#
- pm4py.algo.discovery.genetic.variants.classic.tournament(population: List[Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]]], log: DataFrame | EventLog, T, sort=True, activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Tuple[List[Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]]], List[float]][source]#
sort=True: sort descending by fitness (i.e. best first)
- pm4py.algo.discovery.genetic.variants.classic.sample_parents(population: List[Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]]], fitness: List[float], elitism_min_sample: int)[source]#
- pm4py.algo.discovery.genetic.variants.classic.crossover(parent1: Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]], parent2: Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]], T: List[str]) Tuple[Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]], Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]]][source]#
- pm4py.algo.discovery.genetic.variants.classic.mutate(individual: Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]], rate: float = 0.01) Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]][source]#
- pm4py.algo.discovery.genetic.variants.classic.repair(I: Dict[str, List[FrozenSet[str]]], O: Dict[str, List[FrozenSet[str]]], C: ndarray, T: List[str]) Tuple[Dict[str, List[FrozenSet[str]]], Dict[str, List[FrozenSet[str]]]][source]#
Merging partitions until petri-net is (coherent) workflow net see last requirement in 4. Causal Matrix, Def. 4; https://doi.org/10.1007/11494744_5