pm4py.algo.filtering.ocel 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.filtering.ocel.activity_type_matching 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.filtering.ocel.activity_type_matching.Parameters(value)[source]#

Bases: Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'#
OBJECT_TYPE = 'param:object:type'#
TEMP_COLUMN = 'temp_column'#
TEMP_SEPARATOR = 'temp_separator'#
pm4py.algo.filtering.ocel.activity_type_matching.apply(ocel: OCEL, correspondence_dict: Dict[str, Collection[str]], parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters an object-centric event log keeping only the specified object types with the specified activity set (filters out the rest).

Parameters#

ocel

Object-centric event log

correspondence_dict

Dictionary containing, for every object type of interest, a collection of allowed activities. Example:

{“order”: [“Create Order”], “element”: [“Create Order”, “Create Delivery”]}

Keeps only the object types “order” and “element”. For the “order” object type, only the activity “Create Order” is kept. For the “element” object type, only the activities “Create Order” and “Create Delivery” are kept.

parameters
Parameters of the algorithm, including:
  • Parameters.ACTIVITY_KEY => the activity key

  • Parameters.OBJECT_TYPE => the object type column

Returns#

filtered_ocel

Filtered object-centric event log

pm4py.algo.filtering.ocel.event_attributes 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.filtering.ocel.event_attributes.Parameters(value)[source]#

Bases: Enum

An enumeration.

ATTRIBUTE_KEY = 'pm4py:param:attribute_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
POSITIVE = 'positive'#
pm4py.algo.filtering.ocel.event_attributes.apply(ocel: OCEL, values: Collection[Any], parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the object-centric event log on the provided event attributes values

Parameters#

ocel

Object-centric event log

values

Collection of values

parameters

Parameters of the algorithm, including: - Parameters.ATTRIBUTE_KEY => the attribute that should be filtered - Parameters.POSITIVE => decides if the values should be kept (positive=True) or removed (positive=False)

Returns#

ocel

Filtered object-centric event log

pm4py.algo.filtering.ocel.event_attributes.apply_timestamp(ocel: OCEL, min_timest: Union[datetime, str], max_timest: Union[datetime, str], parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the object-centric event log keeping events in the provided timestamp range

Parameters#

ocel

Object-centric event log

min_timest

Left extreme of the allowed timestamp interval (provided in the format: YYYY-mm-dd HH:MM:SS)

max_timest

Right extreme of the allowed timestamp interval (provided in the format: YYYY-mm-dd HH:MM:SS)

parameters

Parameters of the algorithm, including: - Parameters.TIMESTAMP_KEY => the attribute to use as timestamp

Returns#

filtered_ocel

Filtered object-centric event log

pm4py.algo.filtering.ocel.object_attributes 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.filtering.ocel.object_attributes.Parameters(value)[source]#

Bases: Enum

An enumeration.

ATTRIBUTE_KEY = 'pm4py:param:attribute_key'#
POSITIVE = 'positive'#
pm4py.algo.filtering.ocel.object_attributes.apply(ocel: OCEL, values: Collection[Any], parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the object-centric event log on the provided object attributes values

Parameters#

ocel

Object-centric event log

values

Collection of values

parameters

Parameters of the algorithm, including: - Parameters.ATTRIBUTE_KEY => the attribute that should be filtered - Parameters.POSITIVE => decides if the values should be kept (positive=True) or removed (positive=False)

Returns#

ocel

Filtered object-centric event log

pm4py.algo.filtering.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.algo.filtering.ocel.objects_ot_count.Parameters(value)[source]#

Bases: Enum

An enumeration.

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.algo.filtering.ocel.objects_ot_count.apply(ocel: OCEL, min_num_obj_type: Dict[str, int], parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the events of the object-centric logs which are related to at least the specified amount of objects per type.

E.g. apply(ocel, {“order”: 1, “element”: 2})

Would keep the following events:

ocel:eid ocel:timestamp ocel:activity ocel:type:element ocel:type:order

0 e1 1980-01-01 Create Order [i4, i1, i3, i2] [o1] 1 e11 1981-01-01 Create Order [i6, i5] [o2] 2 e14 1981-01-04 Create Order [i8, i7] [o3]

Parameters#

ocel

Object-centric event log

min_num_obj_type

Minimum number of objects per type

parameters

Parameters of the filter, including: - Parameters.EVENT_ID => the event identifier - Parameters.OBJECT_ID => the object identifier - Parameters.OBJECT_TYPE => the object type

Returns#

filtered_event_log

Filtered object-centric event log

pm4py.algo.filtering.ocel.ot_endpoints 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.filtering.ocel.ot_endpoints.Parameters(value)[source]#

Bases: Enum

An enumeration.

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.algo.filtering.ocel.ot_endpoints.filter_start_events_per_object_type(ocel: OCEL, object_type: str, parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the events in which a new object for the given object type is spawn. (E.g. an event with activity “Create Order” might spawn new orders).

Parameters#

ocel

Object-centric event log

object_type

Object type to consider

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the attribute working as event identifier - Parameters.OBJECT_ID => the attribute working as object identifier - Parameters.OBJECT_TYPE => the attribute working as object type

Returns#

filtered_ocel

Filtered object-centric event log

pm4py.algo.filtering.ocel.ot_endpoints.filter_end_events_per_object_type(ocel: OCEL, object_type: str, parameters: Optional[Dict[Any, Any]] = None) OCEL[source]#

Filters the events in which an object for the given object type terminates its lifecycle. (E.g. an event with activity “Pay Order” might terminate an order).

Parameters#

ocel

Object-centric event log

object_type

Object type to consider

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the attribute working as event identifier - Parameters.OBJECT_ID => the attribute working as object identifier - Parameters.OBJECT_TYPE => the attribute working as object type

Returns#

filtered_ocel

Filtered object-centric event log