numeraire.core.data.FeatureBlock#

class numeraire.core.data.FeatureBlock(frame: DataFrame, *, lag: int = 0, name: str | None = None)[source]#

Bases: object

One time-series feature block: a (date x feature) frame + an availability lag.

A row dated tau becomes usable only lag of the block’s own periods later, so asof(t) returns the row at the latest tau whose position is at or before (latest tau <= t) - lag. lag=0 = period-end-known (prices, GW predictors); lag>=1 = a publication-lagged macro source with no vintage panel (e.g. FRED at lag=1). The lag is counted in this block’s own index steps (v0); contiguous monthly data — the common macro case — makes a step exactly one month.

name labels the source (for errors / provenance); it does not affect alignment.

__init__(frame: DataFrame, *, lag: int = 0, name: str | None = None) None[source]#

Methods

__init__(frame, *[, lag, name])

asof(t)

Feature vector known as of t (lag-aware; the block's real-time edge row).

is_ready(t)

Whether any lag-aware row is available at t (False during the lag warm-up).

truncate(end)

A copy holding only rows dated <= end (raw data truncation; lag applied at asof).

Attributes

names

Feature (column) names of this block.

property names: list[str]#

Feature (column) names of this block.

is_ready(t: object) bool[source]#

Whether any lag-aware row is available at t (False during the lag warm-up).

asof(t: object) NDArray[float64][source]#

Feature vector known as of t (lag-aware; the block’s real-time edge row).

truncate(end: object) FeatureBlock[source]#

A copy holding only rows dated <= end (raw data truncation; lag applied at asof).