SegmentationInput#
- class caf.base.segmentation.SegmentationInput(*, naming_order, enum_segments=<factory>, custom_segments=<factory>, subsets=<factory>)[source]#
Bases:
BaseConfigInput 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
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods
enums()Validate the subsets match segments.
Validate that naming order names match segment 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].
- enum_segments: list[SegmentsSuper][source]#