numeraire.core.data.FeatureBlock#
- class numeraire.core.data.FeatureBlock(frame: DataFrame, *, lag: int = 0, name: str | None = None)[source]#
Bases:
objectOne time-series feature block: a
(date x feature)frame + an availabilitylag.A row dated
taubecomes usable onlylagof the block’s own periods later, soasof(t)returns the row at the latesttauwhose 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 atlag=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.namelabels the source (for errors / provenance); it does not affect alignment.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
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).