pm4py.algo.transformation.trace_encodings.variants.temporal_lazy 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.algo.transformation.trace_encodings.variants.temporal_lazy.Parameters(*values)[source]#

Bases: Enum

ARRIVAL_RATE = 'arrival_rate'#
FINISH_RATE = 'finish_rate'#
CASE_ID_COLUMN = 'pm4py:param:case_id_key'#
START_TIMESTAMP_COLUMN = 'pm4py:param:start_timestamp_key'#
TIMESTAMP_COLUMN = 'pm4py:param:timestamp_key'#
RESOURCE_COLUMN = 'pm4py:param:resource_key'#
ACTIVITY_COLUMN = 'pm4py:param:activity_key'#
GROUPER_FREQ = 'grouper_freq'#
SERVICE_TIME = 'service_time'#
WAITING_TIME = 'waiting_time'#
SOJOURN_TIME = 'sojourn_time'#
DIFF_START_END = 'diff_start_end'#
pm4py.algo.transformation.trace_encodings.variants.temporal_lazy.apply(log, parameters: Dict[Any, Any] | None = None)[source]#

Aggregates a Polars LazyFrame event log into temporal windows.

This is the lazy Polars equivalent of the temporal variant. From an event-log point of view, events are grouped by timestamp windows and each output row describes one window. The returned LazyFrame contains the same feature semantics as the pandas temporal variant, such as unique resources, unique activities, number of events, average waiting/service times, rework counts, and cases/resources per window.

Example with GROUPER_FREQ=”D”:

day 2024-01-01 has 2 cases and 5 events day 2024-01-02 has 1 case and 2 events

The result is a lazy query that, when collected, yields two rows with window-level feature values.

Parameters:
  • log – Polars LazyFrame containing the event log

  • parameters – Parameters of the algorithm (same semantics as the pandas-based temporal variant)

Returns:

Dataframe with temporal features, aggregated per time window

Return type:

pl.DataFrame