cursus.steps.configs.config_registration_step

class VariableType(*values)[source]

Bases: str, Enum

NUMERIC = 'NUMERIC'
TEXT = 'TEXT'
create_inference_variable_list(numeric_fields=None, text_fields=None, output_format='dict')[source]

Create an inference variable list for model input variables using separate lists for numeric and text fields. This is a helper function that can be used standalone or within RegistrationConfig.

Parameters:
  • numeric_fields (List[str]) – List of field names that should be treated as NUMERIC

  • text_fields (List[str]) – List of field names that should be treated as TEXT

  • output_format (str) – Format for storing variable list - either ‘dict’ or ‘list’

Returns:

A dictionary mapping variable names to their types, or a list of [name, type] pairs, depending on the output_format parameter

Return type:

Dict[str, VariableType | str] | List[List[str]]

class RegistrationConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, model_owner, model_domain, model_objective, framework, inference_entry_point, source_model_inference_input_variable_list=<factory>, inference_instance_type='ml.m5.large', source_model_inference_content_types=['text/csv'], source_model_inference_response_types=['application/json'], source_model_inference_output_variable_list={'legacy-score': VariableType.NUMERIC}, **extra_data)[source]

Bases: BasePipelineConfig

Configuration for model registration step, following the three-tier categorization:

Tier 1: Essential User Inputs - fields that users must explicitly provide Tier 2: System Inputs - fields with reasonable defaults that users can override Tier 3: Derived Fields - private fields with read-only property access

model_owner: str
model_domain: str
model_objective: str
framework: str
inference_entry_point: str
source_model_inference_input_variable_list: Dict[str, VariableType | str] | List[List[str]]
inference_instance_type: str
source_model_inference_content_types: List[str]
source_model_inference_response_types: List[str]
source_model_inference_output_variable_list: Dict[str, VariableType]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

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

serialize_output_variable_list(value)[source]

Serialize VariableType enum values to strings

serialize_input_variable_list(value)[source]

Serialize VariableType enum values to strings in input variable list

classmethod validate_inference_instance_type(v)[source]

Validate the inference instance type

classmethod validate_framework(v)[source]

Validate the ML framework

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

validate_registration_configs()[source]

Validate registration-specific configurations (without file existence checks)

classmethod validate_content_types(v)[source]

Validate content and response types

classmethod validate_input_variable_list(v)[source]

Validate input variable list format.

Parameters:

v (Dict[str, VariableType | str] | List[List[str]]) – Either a dictionary of variable names to types, or a list of [variable_name, variable_type] pairs

Returns:

Validated input variable list

Return type:

Dict[str, VariableType | str] | List[List[str]]

classmethod validate_output_variable_list(v)[source]

Validate variable lists and convert to string values

property variable_schema: Dict[str, Dict[str, List[Dict[str, str]]]]

Generate variable schema for model registration

get_variable_schema()[source]

Legacy method that forwards to the property

model_dump(**kwargs)[source]

Override model_dump to include derived properties.

set_source_model_inference_input_variable_list(numeric_fields=None, text_fields=None, output_format='dict')[source]

Set the input variable list for model inference using separate lists for numeric and text fields.

Parameters:
  • numeric_fields (List[str]) – List of field names that should be treated as NUMERIC

  • text_fields (List[str]) – List of field names that should be treated as TEXT

  • output_format (str) – Format for storing variable list - either ‘dict’ or ‘list’

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

author: str
bucket: str
role: str
region: str
service_name: str
pipeline_version: str
model_class: str
current_date: str
framework_version: str
py_version: str
source_dir: str | None
enable_caching: bool
use_secure_pypi: bool
max_runtime_seconds: int
project_root_folder: str