Skip to main content
Version: Beta 🚧

Aggregate

Summary​

The Aggregate class describes an aggregation feature that is applied to a Batch or Stream Feature View via features param.

Example​

from tecton import Aggregate, batch_feature_view, TimeWindow
from tecton.types import Int64
from datetime import timedelta


@batch_feature_view(
# ...
features=[
Aggregate(
column="my_column",
column_dtype=Int64,
function="mean",
time_window=TimeWindow(window_size=timedelta(days=7)),
),
Aggregate(
column="another_column",
column_dtype=Int64,
function="mean",
time_window=TimeWindow(window_size=timedelta(days=1)),
name="1d_average",
),
],
)
def my_fv(data_source):
pass

Methods​

__init__(...)​

Parameters​

  • column (str) – The name of the input/feature column

  • column_dtype (SdkDataType) - The data type of the column

  • function (Union[str, AggregationFunction]) – One of the built-in aggregation functions. See the aggregation functions reference for a list of aggregation functions.

  • time_window (TimeWindow) – The window_size and optional offset over which to aggregate over. See Time Window Reference for more details on the TimeWindow class.

  • name (Optional[str]) – The name of this feature, e.g. transaction_count_7d_1d. Defaults to an autogenerated name.

Was this page helpful?

🧠 Hi! Ask me anything about Tecton!

Floating button icon