neuralset.extractors.meta.TimeAggregatedExtractor¶
- class neuralset.extractors.meta.TimeAggregatedExtractor(*, event_types: str | tuple[str, ...] = 'Event', aggregation: Literal['single', 'sum', 'mean', 'first', 'middle', 'last', 'cat', 'stack', 'trigger'] = 'single', allow_missing: bool = False, frequency: float = 0.0, time_aggregation: Literal['sum', 'mean', 'first', 'last'] = 'mean', n_groups_concat: Annotated[int, Gt(gt=0)] | None = None, extractor: BaseExtractor)[source][source]¶
Remove the time dimension of a dynamic extractor, either by summing/averaging or by selecting the first, middle or last time point.
NOTE: This is not exactly a static extractor because its output depends on the start and duration of the window (whereas static extractors only depend on the event). Hence, the get_static method is not implemented.
- Parameters:
time_aggregation (str) – How to aggregate the time dimension. Can be “sum”, “mean”, “first”, “middle”, “last” or an integer.
n_groups_concat (int | None) – If provided, the time dimension is divided into n_groups equal parts and the aggregation is carried out within each group, before being concatenated.
extractor (BaseExtractor) – The extractor to aggregate.