numeraire.core.engine.WeightsOutput#
- class numeraire.core.engine.WeightsOutput(weights: DataFrame, realized: DataFrame, method: str, config_hash: str, data_vintage: str, run_id: str, capability: str = 'to_weights', meta: dict[str, ~typing.Any]=<factory>, missing_returns: Literal['error', 'zero', 'renormalize_legs']='error', horizon: int = 1)[source]#
Bases:
objectOOS output for a
to_weightsmethod: target weights and aligned realized returns.weightsandrealizedare both(date x asset)indexed by the prediction dates, whererealized.loc[t]is the return over(t, t+h](sostrategy_returnsis the realized, no-look-ahead P&L of holdingweights.loc[t]over that period).weightsalways remains the model’s target decision. If held returns are unavailable,missing_returnscontrols scoring andscoring_weights()exposes any ex-post effective weights separately.- __init__(weights: DataFrame, realized: DataFrame, method: str, config_hash: str, data_vintage: str, run_id: str, capability: str = 'to_weights', meta: dict[str, ~typing.Any]=<factory>, missing_returns: Literal['error', 'zero', 'renormalize_legs']='error', horizon: int = 1) None#
Methods
__init__(weights, realized, method, ...)Effective ex-post weights used only to score returns under
missing_returns.Realized portfolio return per date under the explicit missing-return policy.
Attributes
capabilityEffective forecast horizon
hof the paired targets (steps of the decision calendar).missing_returnsCompact universe label (
n=<#assets>for panels, the name for a single asset).weightsrealizedmethodconfig_hashdata_vintagerun_idmeta- horizon: int = 1#
Effective forecast horizon
hof the paired targets (steps of the decision calendar).Populated by the drivers from the producing view;
1is the default a direct construction keeps.realized.loc[t]is the return over(t, t+h], so an annualizing evaluator that reads it can tell a single-period target from an overlapping multi-period one.
- property universe: str#
Compact universe label (
n=<#assets>for panels, the name for a single asset).