pm4py.algo.discovery.batches.variants package¶
Submodules¶
pm4py.algo.discovery.batches.variants.log 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.discovery.batches.variants.log.Parameters[source]¶ Bases:
enum.EnumAn enumeration.
-
ACTIVITY_KEY= 'pm4py:param:activity_key'¶
-
CASE_ID_KEY= 'pm4py:param:case_id_key'¶
-
MERGE_DISTANCE= 'merge_distance'¶
-
MIN_BATCH_SIZE= 'min_batch_size'¶
-
RESOURCE_KEY= 'pm4py:param:resource_key'¶
-
START_TIMESTAMP_KEY= 'pm4py:param:start_timestamp_key'¶
-
TIMESTAMP_KEY= 'pm4py:param:timestamp_key'¶
-
-
pm4py.algo.discovery.batches.variants.log.apply(log: pm4py.objects.log.obj.EventLog, parameters: Optional[Dict[Union[str, pm4py.algo.discovery.batches.variants.log.Parameters], Any]] = None) → List[Tuple[Tuple[str, str], int, Dict[str, Any]]][source]¶ Provided an event log, returns a list having as elements the activity-resources with the batches that are detected, divided in: - Simultaneous (all the events in the batch have identical start and end timestamps) - Batching at start (all the events in the batch have identical start timestamp) - Batching at end (all the events in the batch have identical end timestamp) - Sequential batching (for all the consecutive events, the end of the first is equal to the start of the second) - Concurrent batching (for all the consecutive events that are not sequentially matched)
The approach has been described in the following paper: Martin, N., Swennen, M., Depaire, B., Jans, M., Caris, A., & Vanhoof, K. (2015, December). Batch Processing: Definition and Event Log Identification. In SIMPDA (pp. 137-140).
Parameters: log – Event log object
parameters – Parameters of the algorithm: - ACTIVITY_KEY => the attribute that should be used as activity - RESOURCE_KEY => the attribute that should be used as resource - START_TIMESTAMP_KEY => the attribute that should be used as start timestamp - TIMESTAMP_KEY => the attribute that should be used as timestamp - CASE_ID_KEY => the attribute that should be used as case identifier - MERGE_DISTANCE => the maximum time distance between non-overlapping intervals in order for them to be
considered belonging to the same batch (default: 15*60 15 minutes)
- MIN_BATCH_SIZE => the minimum number of events for a batch to be considered (default: 2)
Returns: A (sorted) list containing tuples. Each tuple contain: - Index 0: the activity-resource for which at least one batch has been detected - Index 1: the number of batches for the given activity-resource - Index 2: a list containing all the batches. Each batch is described by:
# The start timestamp of the batch # The complete timestamp of the batch # The list of events that are executed in the batch
Return type: list_batches
pm4py.algo.discovery.batches.variants.pandas 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.discovery.batches.variants.pandas.Parameters[source]¶ Bases:
enum.EnumAn enumeration.
-
ACTIVITY_KEY= 'pm4py:param:activity_key'¶
-
CASE_ID_KEY= 'pm4py:param:case_id_key'¶
-
EVENT_ID_KEY= 'event_id_key'¶
-
MERGE_DISTANCE= 'merge_distance'¶
-
MIN_BATCH_SIZE= 'min_batch_size'¶
-
RESOURCE_KEY= 'pm4py:param:resource_key'¶
-
START_TIMESTAMP_KEY= 'pm4py:param:start_timestamp_key'¶
-
TIMESTAMP_KEY= 'pm4py:param:timestamp_key'¶
-
-
pm4py.algo.discovery.batches.variants.pandas.apply(log: pandas.core.frame.DataFrame, parameters: Optional[Dict[Union[str, pm4py.algo.discovery.batches.variants.pandas.Parameters], Any]] = None) → List[Tuple[Tuple[str, str], int, Dict[str, Any]]][source]¶ Provided a Pandas dataframe, returns a list having as elements the activity-resources with the batches that are detected, divided in: - Simultaneous (all the events in the batch have identical start and end timestamps) - Batching at start (all the events in the batch have identical start timestamp) - Batching at end (all the events in the batch have identical end timestamp) - Sequential batching (for all the consecutive events, the end of the first is equal to the start of the second) - Concurrent batching (for all the consecutive events that are not sequentially matched)
The approach has been described in the following paper: Martin, N., Swennen, M., Depaire, B., Jans, M., Caris, A., & Vanhoof, K. (2015, December). Batch Processing: Definition and Event Log Identification. In SIMPDA (pp. 137-140).
Parameters: log – Dataframe
parameters – Parameters of the algorithm: - ACTIVITY_KEY => the attribute that should be used as activity - RESOURCE_KEY => the attribute that should be used as resource - START_TIMESTAMP_KEY => the attribute that should be used as start timestamp - TIMESTAMP_KEY => the attribute that should be used as timestamp - CASE_ID_KEY => the attribute that should be used as case identifier - MERGE_DISTANCE => the maximum time distance between non-overlapping intervals in order for them to be
considered belonging to the same batch (default: 15*60 15 minutes)
- MIN_BATCH_SIZE => the minimum number of events for a batch to be considered (default: 2)
Returns: A (sorted) list containing tuples. Each tuple contain: - Index 0: the activity-resource for which at least one batch has been detected - Index 1: the number of batches for the given activity-resource - Index 2: a list containing all the batches. Each batch is described by:
# The start timestamp of the batch # The complete timestamp of the batch # The list of events that are executed in the batch
Return type: list_batches
Module contents¶
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/>.