pm4py.statistics.ocel package

Submodules

pm4py.statistics.ocel.act_ot_dependent 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.statistics.ocel.act_ot_dependent.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

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_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.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.find_associations_from_ocel(ocel: pm4py.objects.ocel.obj.OCEL, parameters: Optional[Dict[Any, Any]] = None) Dict[str, Dict[str, Set[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

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

Return type

dict_associations

pm4py.statistics.ocel.act_utils 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.statistics.ocel.act_utils.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

EVENT_ACTIVITY = 'param:event:activity'
EVENT_ID = 'param:event:id'
OBJECT_ID = 'param:object:id'
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_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.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.find_associations_from_ocel(ocel: pm4py.objects.ocel.obj.OCEL, parameters: Optional[Dict[Any, Any]] = 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

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

Return type

dict_associations

pm4py.statistics.ocel.act_utils.find_associations_from_relations_df(relations_df: pandas.core.frame.DataFrame, parameters: Optional[Dict[Any, Any]] = None) Dict[str, Set[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

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

Return type

dict_associations

pm4py.statistics.ocel.edge_metrics 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.statistics.ocel.edge_metrics.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

BUSINESS_HOURS = 'business_hours'
EVENT_ACTIVITY = 'param:event:activity'
EVENT_ID = 'param:event:id'
EVENT_TIMESTAMP = 'param:event:timestamp'
OBJECT_ID = 'param:object:id'
OBJECT_TYPE = 'param:object:type'
WEEKENDS = 'weekends'
WORKCALENDAR = 'workcalendar'
WORKTIMING = 'worktiming'
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

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_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

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

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.find_associations_per_edge(ocel: pm4py.objects.ocel.obj.OCEL, parameters: Optional[Dict[Any, Any]] = 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

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

edges

pm4py.statistics.ocel.edge_metrics.performance_calculation_ocel_aggregation(ocel: pm4py.objects.ocel.obj.OCEL, aggregation: Dict[str, Dict[Tuple[str, str], Set[Any]]], parameters: Optional[Dict[Any, Any]] = 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.WORKTIMING => the work timing (default: [7, 17]) - Parameters.WEEKENDS => the weekends (default: [6, 7])

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.objects_ot_count 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.statistics.ocel.objects_ot_count.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

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: pm4py.objects.ocel.obj.OCEL, parameters: Optional[Dict[Any, Any]] = 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

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

Return type

dict_ot

pm4py.statistics.ocel.ot_activities 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.statistics.ocel.ot_activities.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

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: pm4py.objects.ocel.obj.OCEL, parameters: Optional[Dict[Any, Any]] = 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

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

Return type

dict

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