pm4py.algo.transformation.to_embeddings.algorithm 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.transformation.to_embeddings.algorithm.Variants(*values)[source]#

Bases: Enum

CASES_TRANSFORMERS = <module 'pm4py.algo.transformation.to_embeddings.variants.cases_transformers' from '/home/berti/pm4py/pm4py/algo/transformation/to_embeddings/variants/cases_transformers.py'>#
EVENTS_TRANSFORMERS = <module 'pm4py.algo.transformation.to_embeddings.variants.events_transformers' from '/home/berti/pm4py/pm4py/algo/transformation/to_embeddings/variants/events_transformers.py'>#
pm4py.algo.transformation.to_embeddings.algorithm.apply(log: DataFrame, variant=Variants.CASES_TRANSFORMERS, parameters: Dict[Any, Any] | None = None) Tuple[List[str], List[List[float]]][source]#

Computes the embeddings (case/event level, depending on the variant) of the provided dataframe.

Parameters:
  • log – Pandas dataframe

  • variant – Variant of the algorithm, including: - Variants.CASES_TRANSFORMERS => computes the embeddings at the case level - Variants.EVENTS_TRANSFORMERS => computes the embeddings at the event level

  • parameters – Variant-specific parameters

Returns:

  • ids – Identifiers of the considered events/cases

  • embeddings_list – List of embeddings for the considered events/cases

pm4py.algo.transformation.to_embeddings.algorithm.keep_top_k_per_similarity(log: DataFrame, target_sentence: str, k: int, variant=Variants.CASES_TRANSFORMERS, parameters: Dict[Any, Any] | None = None) DataFrame[source]#

Keeps the top K events/cases per similarity

Parameters:
  • log – Pandas dataframe

  • variant – Variant of the algorithm, including: - Variants.CASES_TRANSFORMERS => computes the embeddings at the case level - Variants.EVENTS_TRANSFORMERS => computes the embeddings at the event level

  • parameters – Variant-specific parameters

Returns:

Filtered event log

Return type:

filtered_log