numeraire.core.protocols.Model#

class numeraire.core.protocols.Model(*args, **kwargs)[source]#

Bases: Protocol

A fitted model. Exposes whatever capabilities it has — capabilities, not mandatory methods.

Optional, dispatched by capability (do NOT make these mandatory): to_weights(view) -> pd.DataFrame | pd.Series, expected_returns(view) -> pd.DataFrame, to_density(view), to_surface(view), …

Capability → method-name mapping (the three crystallized surfaces follow different naming patterns, so an extension author must map deliberately, not by rote):

  • capabilities.TO_WEIGHTSto_weights()

  • capabilities.TO_FORECASTforecast() (not to_forecast)

  • capabilities.TO_PRICINGexpected_returns() (not to_pricing)

A model declaring a capability must expose its mapped method; the conformance suite (numeraire.testing.check_capabilities) enforces this.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

capabilities()

The set of capability names this model supports (see numeraire.core.capabilities).

capabilities() set[str][source]#

The set of capability names this model supports (see numeraire.core.capabilities).