neuralset.extractors.neuro.HrfConvolve

pydantic model neuralset.extractors.neuro.HrfConvolve[source][source]

Convolve the output of an extractor by the Hemodynamic Response Function.

Note that this extractor does not support timelines with events.start < 0. Note that this is stored by timeline. If the events change in a timeline, e.g. by using different transform with a similar, then there will be a silent bug.

Parameters:
  • extractor (BaseExtractor) – the extractor used for feature extraction

  • frequency (Literal["native"]) – The frequency of the cropped extractor. Must be “native”. Never used

Fields:
field event_types: str | tuple[str, ...] = 'Event'[source]
field extractor: BaseExtractor [Required][source]
field offset: float = 0[source]
field duration: Annotated[float, Gt(gt=0)] | None = None[source]
field frequency: Annotated[float, Gt(gt=0)] [Required][source]
field infra: MapInfra = MapInfra()[source]
field aggregation: Literal['mean'] = 'mean'[source]
requirements: ClassVar[tuple[str, ...]] = ('nilearn',)[source]
prepare(obj: Any) 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.