numeraire.core.data.PanelTensor#

class numeraire.core.data.PanelTensor(dates: DatetimeIndex, assets: list[str], chars: list[str], features: NDArray[float64], returns: NDArray[float64], mask: NDArray[bool])[source]#

Bases: object

A dense (T x N x K) materialization of a ragged panel — the eject for tensor/NN methods.

features[t, j] is asset assets[j]’s characteristic vector at dates[t] (nan where the asset is absent), returns[t, j] its period return, and mask[t, j] whether it is present. Long stays the source of truth (ragged, ecosystem-native); this is derived on demand — dense + a mask is exactly how deep asset-pricing models (Gu-Kelly-Xiu, Chen-Pelger-Zhu) ingest an unbalanced panel. Padding is nan (not 0) so imputation stays the method’s choice.

__init__(dates: DatetimeIndex, assets: list[str], chars: list[str], features: NDArray[float64], returns: NDArray[float64], mask: NDArray[bool]) None#

Methods

__init__(dates, assets, chars, features, ...)

Attributes

dates

assets

chars

features

returns

mask