Aggregate
Summary​
TheAggregate 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, TimeWindowfrom tecton.types import Int64from datetime import timedelta@batch_feature_view(# ...features=[Aggregate(input_column=Field("my_column", Int64),function="mean",time_window=TimeWindow(window_size=timedelta(days=7)),),Aggregate(input_column=Field("another_column", Int64),function="mean",time_window=TimeWindow(window_size=timedelta(days=1)),name="1d_average",description="my aggregate feature description",tags={"tag": "value"}),],)def my_fv(data_source):pass
For a list of available aggregation functions, see Aggregation Functions.
Methods​
__init__(...)​
Parameters
description: Optional[str] = NoneA human-readable description of the featuretags: Optional[Dict[str, str]] = NoneTags associated with the feature (key-value pairs of user-defined metadata).function: AggregationFunction = NoneOne of the built-in aggregation functions, such as "sum", "count",last(2)etc.time_window: Union[TimeWindow, TimeWindowSeries, LifetimeWindow] = NoneThe window_size and optional offset over which to aggregate over.name: Optional[str] = NoneThe name of this feature. Defaults to an autogenerated name, e.g. transaction_count_7d_1d.input_column: Field = NoneDescribes name and type of the column that will be used in the aggregation.