pm4py.statistics.ocel package#

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

Submodules#

pm4py.statistics.ocel.act_ot_dependent 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.statistics.ocel.act_ot_dependent.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

OBJECT_TYPE = 'param:object:type'#
pm4py.statistics.ocel.act_ot_dependent.aggregate_events(associations: Dict[str, Dict[str, Set[Tuple[str, str]]]]) Dict[str, Dict[str, Set[Tuple[str, str]]]][source]#

Utility method to calculate the “events” metric from the object-type specific associations.

pm4py.statistics.ocel.act_ot_dependent.aggregate_unique_objects(associations: Dict[str, Dict[str, Set[Tuple[str, str]]]]) Dict[str, Dict[str, Set[Tuple[str, str]]]][source]#

Utility method to calculate the “unique objects” metric from the object-type specific associations.

pm4py.statistics.ocel.act_ot_dependent.aggregate_total_objects(associations: Dict[str, Dict[str, Set[Tuple[str, str]]]]) Dict[str, Dict[str, Set[Tuple[str, str]]]][source]#

Utility method to calculate the “total objects” metric from the object-type specific associations.

pm4py.statistics.ocel.act_ot_dependent.find_associations_from_ocel(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, List[Tuple[str, str]]]][source]#

Associates each object type and activity in the object-centric event log with the combinations of event identifiers and objects that are associated to them.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the method, including: - Parameters.EVENT_ID => the attribute to use as event identifier - Parameters.OBJECT_ID => the attribute to use as object identifier - Parameters.EVENT_ACTIVITY => the attribute to use as activity

Returns#

dict_associations

Dictionary that associates each object type (first key) and activity (second key) to its (ev. id, obj id.) combinations.

pm4py.statistics.ocel.act_utils 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.statistics.ocel.act_utils.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
EVENT_ACTIVITY = 'param:event:activity'#
PREFILTERING = 'prefiltering'#
pm4py.statistics.ocel.act_utils.aggregate_events(associations: Dict[str, Set[Tuple[str, str]]]) Dict[str, Set[str]][source]#

Utility method to calculate the “events” metric from the associations.

pm4py.statistics.ocel.act_utils.aggregate_unique_objects(associations: Dict[str, Set[Tuple[str, str]]]) Dict[str, Set[str]][source]#

Utility method to calculate the “unique objects” metric from the associations.

pm4py.statistics.ocel.act_utils.aggregate_total_objects(associations: Dict[str, Set[Tuple[str, str]]]) Dict[str, Set[Tuple[str, str]]][source]#

Utility method to calculate the “total objects” metric from the associations.

pm4py.statistics.ocel.act_utils.find_associations_from_relations_df(relations_df: DataFrame, parameters: Dict[Any, Any] | None = None) Dict[str, List[Tuple[str, str]]][source]#

Associates each activity in the relationship dataframe with the combinations of event identifiers and objects that are associated to the activity.

Parameters#

rel_df

Relations dataframe

parameters

Parameters of the method, including: - Parameters.EVENT_ID => the attribute to use as event identifier - Parameters.OBJECT_ID => the attribute to use as object identifier - Parameters.EVENT_ACTIVITY => the attribute to use as activity

Returns#

dict_associations

Dictionary that associates each activity to its (ev. id, obj id.) combinations.

pm4py.statistics.ocel.act_utils.find_associations_from_ocel(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Set[Any]][source]#

Associates each activity in the OCEL with the combinations of event identifiers and objects that are associated to the activity.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the method, including: - Parameters.EVENT_ID => the attribute to use as event identifier - Parameters.OBJECT_ID => the attribute to use as object identifier - Parameters.EVENT_ACTIVITY => the attribute to use as activity

Returns#

dict_associations

Dictionary that associates each activity to its (ev. id, obj id.) combinations.

pm4py.statistics.ocel.edge_metrics 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.statistics.ocel.edge_metrics.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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, provided as a list of tuples where each tuple represents one time slot of business hours. One slot i.e. one tuple consists of one start and one end time given in seconds since week start, e.g. [

(7 * 60 * 60, 17 * 60 * 60), ((24 + 7) * 60 * 60, (24 + 12) * 60 * 60), ((24 + 13) * 60 * 60, (24 + 17) * 60 * 60),

] meaning that business hours are Mondays 07:00 - 17:00 and Tuesdays 07:00 - 12:00 and 13:00 - 17:00

Returns#

edges_performance

For each object type, associate a dictionary where to each activity couple all the times between the activities are recorded.

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

Edges calculated using the find_associations_per_edge function

Returns#

aggregation

A dictionary associating to each object type another dictionary where to each edge (activity couple) all the couples of related events are associated.

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

Edges calculated using the find_associations_per_edge function

Returns#

aggregation

A dictionary associating to each object type another dictionary where to each edge (activity couple) all the involved objects are associated.

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

Edges calculated using the find_associations_per_edge function

Returns#

aggregation

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.

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.

pm4py.statistics.ocel.objects_ot_count 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.statistics.ocel.objects_ot_count.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.statistics.ocel.objects_ot_count.get_objects_ot_count(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, int]][source]#

Counts for each event the number of related objects per type

Parameters#

ocel

Object-centric Event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier to be used - Parameters.OBJECT_ID => the object identifier to be used - Parameters.OBJECT_TYPE => the object type to be used

Returns#

dict_ot

Dictionary associating to each event identifier a dictionary with the number of related objects

pm4py.statistics.ocel.ot_activities 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.statistics.ocel.ot_activities.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
OBJECT_TYPE = 'param:object:type'#
TEMP_COLUMN = 'temp_column'#
TEMP_SEPARATOR = 'temp_separator'#
pm4py.statistics.ocel.ot_activities.get_object_type_activities(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Collection[str]][source]#

Gets the set of activities performed for each object type

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY => the activity key - Parameters.OBJECT_TYPE => the object type column

Returns#

dict

A dictionary having as key the object types and as values the activities performed for that object type