pm4py.objects.petri_net.utils.embeddings_similarity 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.objects.petri_net.utils.embeddings_similarity.petri_net_embedding(net, dimensions: int = 64, num_walks: int = 10, walk_length: int = 40, window: int = 5, workers: int = 1, epochs: int = 10, readout: str = 'mean', transition_only: bool = False, seed: int = 42) → ndarray[source]#
Return type:

np.ndarray (shape = [dimensions,])

pm4py.objects.petri_net.utils.embeddings_similarity.cosine_similarity(a, b, eps=1e-10)[source]#
pm4py.objects.petri_net.utils.embeddings_similarity.apply(net1: PetriNet, net2: PetriNet) → float[source]#

Computes the embeddings-based similarity between two Petri nets, based on the approach described in:

Colonna, Juan G., et al. “Process mining embeddings: Learning vector representations for Petri nets.” Intelligent Systems with Applications 23 (2024): 200423.

Parameters:
  • net1 – Petri net

  • net2 – Second Petri net

Returns:

Cosine similarity between the two embeddings

Return type:

similarity_metric