neuralset.extractors.meta.AggregatedExtractor

pydantic model neuralset.extractors.meta.AggregatedExtractor[source][source]

Aggregate multiple extractors along the specified dimension. Note that self.extractor_aggregation determines how the extractors are aggregated for a given event, whereas self.aggregation determines how different events are aggregated (after the extractors have been aggregated).

Fields:
field event_types: str | tuple[str, ...] = 'Event'[source]
field extractors: list[BaseExtractor] [Required][source]
field extractor_aggregation: Literal['cat', 'stack', 'mean', 'sum'] = 'cat'[source]
field frequency: Literal['native'] = 'native'[source]
prepare(events: DataFrame) None[source][source]

Pre-compute and cache extractor data for a collection of events.

This method triggers _get_data on every matching event so that expensive computation (e.g. model inference) is done once and cached. It then calls the extractor on a single event to populate the output shape, which is needed when allow_missing=True.

Call prepare before using the extractor in a dataloader.

Parameters:

obj (DataFrame or sequence of Event or sequence of Segment) – The structure containing the events. When calling prepare on several objects, prefer passing a list of events or segments over a DataFrame to avoid redundant conversion overhead.

requirements: tp.ClassVar[tuple[str, ...]] = ()[source]