pm4py.algo.label_splitting.variants package#

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/>.

Submodules#

pm4py.algo.label_splitting.variants.contextual 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.label_splitting.variants.contextual.Parameters(value)[source]#

Bases: Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
INDEX_KEY = 'index_key'#
TARGET_COLUMN = 'target_column'#
ACTIVITIES_SUFFIX = 'activities_suffix'#
TARGET_ACTIVITIES = 'target_activities'#
PREFIX_LENGTH = 'prefix_length'#
SUFFIX_LENGTH = 'suffix_length'#
MIN_EDGE_WEIGHT = 'min_edge_weight'#
pm4py.algo.label_splitting.variants.contextual.apply(log: Union[EventLog, EventStream, DataFrame], parameters: Optional[Dict[Any, Any]] = None) DataFrame[source]#

Applies the technique of contextual label-splitting, to distinguish between different meanings of the same activity. The result is a Pandas dataframe where the contextual label-splitting has been applied.

Reference paper: van Zelst, Sebastiaan J., et al. “Context-Based Activity Label-Splitting.” International Conference on Business Process Management. Cham: Springer Nature Switzerland, 2023.

Minimum Viable Example:

import pm4py from pm4py.algo.label_splitting import algorithm as label_splitter

log = pm4py.read_xes(“tests/input_data/receipt.xes”) log2 = label_splitter.apply(log, variant=label_splitter.Variants.CONTEXTUAL)

Parameters#

log

Event log

parameters

Possible parameters of the algorithm, including: - Parameters.PREFIX_LENGTH => the length of the prefix to consider in the context - Parameters.SUFFIX_LENGTH => the length of the suffix to consider in the context - Parameters.MIN_EDGE_WEIGHT => the minimum weight for an edge to be included in the segments graph - Parameters.TARGET_ACTIVITIES => the activities which should be targeted by the relabeling (default: all) - Parameters.TARGET_COLUMN => the column that should contain the re-labeled activity

Returns#

dataframe

Pandas dataframe with the re-labeling