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:
objectA dense
(T x N x K)materialization of a ragged panel — the eject for tensor/NN methods.features[t, j]is assetassets[j]’s characteristic vector atdates[t](nanwhere the asset is absent),returns[t, j]its period return, andmask[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 isnan(not0) 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
datesassetscharsfeaturesreturnsmask