pm4py.statistics.attributes.log package

Submodules

pm4py.statistics.attributes.log.get 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.attributes.log.get.Parameters[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
ATTRIBUTE_KEY = 'pm4py:param:attribute_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
KEEP_ONCE_PER_CASE = 'keep_once_per_case'
MAX_NO_POINTS_SAMPLE = 'max_no_of_points_to_sample'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
pm4py.statistics.attributes.log.get.get_all_event_attributes_from_log(log: pm4py.objects.log.obj.EventLog) → Set[str][source]

Get all events attributes from the log

Parameters:log – Log
Returns:All trace attributes from the log
Return type:all_attributes
pm4py.statistics.attributes.log.get.get_all_trace_attributes_from_log(log: pm4py.objects.log.obj.EventLog) → Set[str][source]

Get all trace attributes from the log

Parameters:log – Log
Returns:All trace attributes from the log
Return type:all_attributes
pm4py.statistics.attributes.log.get.get_attribute_values(log: pm4py.objects.log.obj.EventLog, attribute_key: str, parameters: Optional[Dict[Union[str, pm4py.statistics.attributes.log.get.Parameters], Any]] = None) → Dict[Any, int][source]

Get the attribute values of the log for the specified attribute along with their count

Parameters:
  • log – Log
  • attribute_key – Attribute for which we would like to know the values along with their count
  • parameters – Possible parameters of the algorithm
Returns:

Dictionary of attributes associated with their count

Return type:

attributes

pm4py.statistics.attributes.log.get.get_events_distribution(log: pm4py.objects.log.obj.EventLog, distr_type: str = 'days_month', parameters: Optional[Dict[Union[str, pm4py.statistics.attributes.log.get.Parameters], Any]] = None) → Tuple[List[str], List[int]][source]

Gets the distribution of the events in the specified dimension

Parameters:
  • log – Event log
  • distr_type – Type of distribution: - days_month => Gets the distribution of the events among the days of a month (from 1 to 31) - months => Gets the distribution of the events among the months (from 1 to 12) - years => Gets the distribution of the events among the years of the event log - hours => Gets the distribution of the events among the hours of a day (from 0 to 23) - days_week => Gets the distribution of the events among the days of a week (from Monday to Sunday)
  • parameters – Parameters of the algorithm, including: - Parameters.TIMESTAMP_KEY
Returns:

  • x – Points (of the X-axis)
  • y – Points (of the Y-axis)

pm4py.statistics.attributes.log.get.get_kde_date_attribute(log, attribute='time:timestamp', parameters=None)[source]

Gets the KDE estimation for the distribution of a date attribute values

Parameters:
  • log – Event stream object (if log, is converted)

  • attribute – Date attribute to analyse

  • parameters

    Possible parameters of the algorithm, including:

    graph_points -> number of points to include in the graph

Returns:

  • x – X-axis values to represent
  • y – Y-axis values to represent

pm4py.statistics.attributes.log.get.get_kde_date_attribute_json(log, attribute='time:timestamp', parameters=None)[source]

Gets the KDE estimation for the distribution of a date attribute values (expressed as JSON)

Parameters:
  • log – Event stream object (if log, is converted)

  • attribute – Date attribute to analyse

  • parameters

    Possible parameters of the algorithm, including:

    graph_points -> number of points to include in the graph

Returns:

  • x – X-axis values to represent
  • y – Y-axis values to represent

pm4py.statistics.attributes.log.get.get_kde_numeric_attribute(log, attribute, parameters=None)[source]

Gets the KDE estimation for the distribution of a numeric attribute values

Parameters:
  • log – Event stream object (if log, is converted)

  • attribute – Numeric attribute to analyse

  • parameters

    Possible parameters of the algorithm, including:

    graph_points -> number of points to include in the graph

Returns:

  • x – X-axis values to represent
  • y – Y-axis values to represent

pm4py.statistics.attributes.log.get.get_kde_numeric_attribute_json(log, attribute, parameters=None)[source]

Gets the KDE estimation for the distribution of a numeric attribute values (expressed as JSON)

Parameters:
  • log – Event log object (if log, is converted)

  • attribute – Numeric attribute to analyse

  • parameters

    Possible parameters of the algorithm, including:

    graph_points -> number of points to include in the graph

Returns:

  • x – X-axis values to represent
  • y – Y-axis values to represent

pm4py.statistics.attributes.log.get.get_trace_attribute_values(log: pm4py.objects.log.obj.EventLog, attribute_key: str, parameters: Optional[Dict[Union[str, pm4py.statistics.attributes.log.get.Parameters], Any]] = None) → Dict[Any, int][source]

Get the attribute values of the log for the specified attribute along with their count

Parameters:
  • log – Log
  • attribute_key – Attribute for which we wish to get the values along with their count
  • parameters – Possible parameters of the algorithm
Returns:

Dictionary of attributes associated with their count

Return type:

attributes

pm4py.statistics.attributes.log.select 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/>.

pm4py.statistics.attributes.log.select.check_event_attributes_presence(log: pm4py.objects.log.obj.EventLog, attributes_set: Union[Set[str], List[str]]) → Union[Set[str], List[str]][source]

Check event attributes presence in all the traces of the log

Parameters:
  • log – Log
  • attributes_set – Set of attributes
Returns:

Filtered set of attributes

Return type:

filtered_set

pm4py.statistics.attributes.log.select.check_trace_attributes_presence(log: pm4py.objects.log.obj.EventLog, attributes_set: Union[Set[str], List[str]]) → Union[Set[str], List[str]][source]

Check trace attributes presence in all the traces of the log

Parameters:
  • log – Log
  • attributes_set – Set of attributes
Returns:

Filtered set of attributes

Return type:

filtered_set

pm4py.statistics.attributes.log.select.select_attributes_from_log_for_tree(log: pm4py.objects.log.obj.EventLog, max_cases_for_attr_selection=50, max_diff_occ=12.5)[source]

Select attributes from log for tree

Parameters:
  • log – Log
  • max_cases_for_attr_selection – Maximum number of cases to consider for attribute selection
  • max_diff_occ – Maximum number of different occurrences
pm4py.statistics.attributes.log.select.verify_if_event_attribute_is_in_each_trace(log: pm4py.objects.log.obj.EventLog, attribute: str) → bool[source]

Verify if the event attribute is in each trace

Parameters:
  • log – Log
  • attribute – Attribute
Returns:

Boolean value that is aiming to check if the event attribute is in each trace

Return type:

boolean

pm4py.statistics.attributes.log.select.verify_if_trace_attribute_is_in_each_trace(log: pm4py.objects.log.obj.EventLog, attribute: str) → bool[source]

Verify if the trace attribute is in each trace

Parameters:
  • log – Log
  • attribute – Attribute
Returns:

Boolean value that is aiming to check if the trace attribute is in each trace

Return type:

boolean

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