pm4py.statistics.ocel.edge_metrics 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
- class pm4py.statistics.ocel.edge_metrics.Parameters(*values)[source]#
Bases:
Enum- EVENT_ID = 'param:event:id'#
- OBJECT_ID = 'param:object:id'#
- OBJECT_TYPE = 'param:object:type'#
- EVENT_ACTIVITY = 'param:event:activity'#
- EVENT_TIMESTAMP = 'param:event:timestamp'#
- BUSINESS_HOURS = 'business_hours'#
- BUSINESS_HOUR_SLOTS = 'business_hour_slots'#
- WORKCALENDAR = 'workcalendar'#
- pm4py.statistics.ocel.edge_metrics.performance_calculation_ocel_aggregation(ocel: OCEL, aggregation: Dict[str, Dict[Tuple[str, str], Set[Any]]], parameters: Dict[Any, Any] | None = None) Dict[str, Dict[Tuple[str, str], List[float]]][source]#
Calculates the performance based on one of the following aggregations: - aggregate_ev_couples - aggregate_total_objects
- Parameters:
ocel – Object-centric event log
aggregation – Aggregation calculated using one of the aforementioned methods
parameters – Parameters of the algorithm, including:
Parameters.EVENT_ID => the event identifier
Parameters.EVENT_TIMESTAMP => the timestamp
Parameters.BUSINESS_HOURS => enables/disables the business hours
Parameters.BUSINESS_HOURS_SLOTS => work schedule of the company. The following list defines that business hours are Mondays 07:00 - 17:00 and Tuesdays 07:00 - 12:00 and 13:00 - 17:00:
[ (7 * 60 * 60, 17 * 60 * 60), ((24 + 7) * 60 * 60, (24 + 12) * 60 * 60), ((24 + 13) * 60 * 60, (24 + 17) * 60 * 60), ]
- Returns:
For each object type, associate a dictionary where to each activity couple all the times between the activities are recorded.
- Return type:
edges_performance
- pm4py.statistics.ocel.edge_metrics.aggregate_ev_couples(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#
Performs an aggregation of the occurrences of a given edge on the couple of events (source event, target event).
- Parameters:
edges (dict) – Edges calculated using the find_associations_per_edge function
- Returns:
A dictionary associating to each object type another dictionary where to each edge (activity couple) all the couples of related events are associated.
- Return type:
aggregation
- pm4py.statistics.ocel.edge_metrics.aggregate_unique_objects(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#
Performs an aggregation of the occurrences of a given edge in the involved object.
- Parameters:
edges (dict) – Edges calculated using the find_associations_per_edge function
- Returns:
A dictionary associating to each object type another dictionary where to each edge (activity couple) all the involved objects are associated.
- Return type:
aggregation
- pm4py.statistics.ocel.edge_metrics.aggregate_total_objects(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#
Performs an aggregation of the occurrences of a given edge on the triple (source event, target event, object).
- Parameters:
edges (dict) – Edges calculated using the find_associations_per_edge function
- Returns:
A dictionary associating to each object type another dictionary where to each edge (activity couple) all the triples (source event, target event, object) are associated.
- Return type:
aggregation
- pm4py.statistics.ocel.edge_metrics.find_associations_per_edge(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[Tuple[str, str], Collection[Any]]][source]#
Finds all the occurrences of a given edge (activity couple), expressed as triples (source event, target event, object ID).
- Parameters:
ocel – Object-centric event log
parameters – Parameters of the algorithm, including: - Parameters.EVENT_ACTIVITY => the activity - Parameters.EVENT_ID => the event identifier - Parameters.OBJECT_ID => the object identifier - Parameters.OBJECT_TYPE => the object type
- Returns:
edges – A dictionary associating to each object type a dictionary where to each edge (activity couple) the list of triples (source event, target event, object ID) is associated.
- Return type: