SegmentationInput#

class caf.base.SegmentationInput(*, naming_order, enum_segments=<factory>, custom_segments=<factory>, subsets=<factory>)[source]#

Bases: BaseConfig

Input class for segmentation objects.

Parameters:
  • enum_segments (list[SegmentsSuper]) – Provide as strings matching enumerations in SegmentsSuper. In 99% of cases segments should be provided in this form. If a segment doesn’t exist in the enumeration it should usually be added.

  • subsets (dict[str, list[int]]) – Define any segments you want subsets of. Keys should match values in ‘enum_segments’, values should be lists defining values from the segment which should be included.

  • custom_segments (list[Segment]) – User defined segments which don’t appear in SegmentsSuper. As stated, in almost all cases a missing segment should be added to that class, and this option is a contingency.

  • naming_order (list[str]) – The naming order of the segments. This primarily affects the index order of the multi-index formed from the segmentation.

Attributes

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

naming_order

enum_segments

custom_segments

subsets

Methods

enums()

Validate the subsets match segments.

names_match_segments()

Validate that naming order names match segment names.

no_copied_names()

Validate the custom_segments do not clash with existing segments.

Attributes Documentation

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

naming_order: list[str][source]#
enum_segments: list[SegmentsSuper][source]#
custom_segments: list[Segment][source]#
subsets: dict[str, list[int]][source]#