bayesline.api.equity.RiskDatasetUploadedExposureSettings#

pydantic model bayesline.api.equity.RiskDatasetUploadedExposureSettings#

Settings for uploaded exposure data in a risk dataset.

This class defines settings for using exposure data from uploaded sources, with options for gaussianization, missing value filling, and factor group management.

Show JSON schema
{
   "title": "RiskDatasetUploadedExposureSettings",
   "description": "Settings for uploaded exposure data in a risk dataset.\n\nThis class defines settings for using exposure data from uploaded sources,\nwith options for gaussianization, missing value filling, and factor group management.",
   "type": "object",
   "properties": {
      "exposure_type": {
         "const": "uploaded",
         "default": "uploaded",
         "title": "Exposure Type",
         "type": "string"
      },
      "exposure_source": {
         "description": "The uploaded source of the exposures.",
         "title": "Exposure Source",
         "type": "string"
      },
      "continuous_factor_groups": {
         "description": "The continuous factor groups from the uploaded dataset to carry over.",
         "items": {
            "type": "string"
         },
         "title": "Continuous Factor Groups",
         "type": "array"
      },
      "categorical_factor_groups": {
         "description": "The categorical factor groups from the uploaded dataset to carry over.",
         "items": {
            "type": "string"
         },
         "title": "Categorical Factor Groups",
         "type": "array"
      },
      "factor_groups_forward_fill": {
         "description": "For which factor groups to forward-fill exposures along time, gated by the priced-day mask (no fill on days the asset is not in the modeling universe). Applied before gaussianizing and fill_miss. Supports both continuous (dense) and categorical (sparse) groups; for categorical groups the fill preserves one-hot semantics within each (asset, group) when the upload itself is one-hot. Each entry must also appear in ``continuous_factor_groups`` or ``categorical_factor_groups``.",
         "items": {
            "type": "string"
         },
         "title": "Factor Groups Forward Fill",
         "type": "array"
      },
      "factor_groups_gaussianize": {
         "description": "For which continuous groups to gaussianize the exposures. Each entry must also appear in ``continuous_factor_groups``.",
         "items": {
            "type": "string"
         },
         "title": "Factor Groups Gaussianize",
         "type": "array"
      },
      "factor_groups_gaussianize_maintain_zeros": {
         "description": "For which continuous groups to gaussianize the exposures and maintain zeros. ``maintain_zeros`` only takes effect during gaussianization, so each entry must also appear in ``factor_groups_gaussianize`` (and therefore in ``continuous_factor_groups``).",
         "items": {
            "type": "string"
         },
         "title": "Factor Groups Gaussianize Maintain Zeros",
         "type": "array"
      },
      "factor_groups_fill_miss": {
         "description": "For which continuous groups to fill missing values. Each entry must also appear in ``continuous_factor_groups``.",
         "items": {
            "type": "string"
         },
         "title": "Factor Groups Fill Miss",
         "type": "array"
      },
      "hierarchy_sources": {
         "additionalProperties": {
            "type": "string"
         },
         "description": "Mapping from factor group name to uploaded hierarchy dataset name. Factor groups not in this mapping use a flat hierarchy from factor names.",
         "title": "Hierarchy Sources",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "exposure_source"
   ]
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • categorical_factor_groups (list[str])

  • continuous_factor_groups (list[str])

  • exposure_source (str)

  • exposure_type (Literal['uploaded'])

  • factor_groups_fill_miss (list[str])

  • factor_groups_forward_fill (list[str])

  • factor_groups_gaussianize (list[str])

  • factor_groups_gaussianize_maintain_zeros (list[str])

  • hierarchy_sources (dict[str, str])

Validators:
  • _validate_factor_group_references » all fields

field exposure_type: Literal['uploaded'] = 'uploaded'#
Validated by:
  • _validate_factor_group_references

field exposure_source: str [Required]#

The uploaded source of the exposures.

Validated by:
  • _validate_factor_group_references

field continuous_factor_groups: Annotated[list[str]] [Optional]#

The continuous factor groups from the uploaded dataset to carry over.

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field categorical_factor_groups: Annotated[list[str]] [Optional]#

The categorical factor groups from the uploaded dataset to carry over.

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field factor_groups_forward_fill: Annotated[list[str]] [Optional]#

For which factor groups to forward-fill exposures along time, gated by the priced-day mask (no fill on days the asset is not in the modeling universe). Applied before gaussianizing and fill_miss. Supports both continuous (dense) and categorical (sparse) groups; for categorical groups the fill preserves one-hot semantics within each (asset, group) when the upload itself is one-hot. Each entry must also appear in continuous_factor_groups or categorical_factor_groups.

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field factor_groups_gaussianize: Annotated[list[str]] [Optional]#

For which continuous groups to gaussianize the exposures. Each entry must also appear in continuous_factor_groups.

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field factor_groups_gaussianize_maintain_zeros: Annotated[list[str]] [Optional]#

For which continuous groups to gaussianize the exposures and maintain zeros. maintain_zeros only takes effect during gaussianization, so each entry must also appear in factor_groups_gaussianize (and therefore in continuous_factor_groups).

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field factor_groups_fill_miss: Annotated[list[str]] [Optional]#

For which continuous groups to fill missing values. Each entry must also appear in continuous_factor_groups.

Constraints:
  • func = <function _require_unique at 0x7f0bc6106020>

Validated by:
  • _validate_factor_group_references

field hierarchy_sources: dict[str, str] [Optional]#

Mapping from factor group name to uploaded hierarchy dataset name. Factor groups not in this mapping use a flat hierarchy from factor names.

Validated by:
  • _validate_factor_group_references