cursus.steps.configs.config_missing_value_imputation_step

Missing Value Imputation Configuration with Self-Contained Derivation Logic

This module implements the configuration class for SageMaker Processing steps for missing value imputation, using a self-contained design where each field is properly categorized according to the three-tier design: 1. Essential User Inputs (Tier 1) - Required fields that must be provided by users 2. System Fields (Tier 2) - Fields with reasonable defaults that can be overridden 3. Derived Fields (Tier 3) - Fields calculated from other fields, private with read-only properties

class MissingValueImputationConfig(*, 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, processing_instance_count=1, processing_volume_size=500, processing_instance_type_large='ml.m5.4xlarge', processing_instance_type_small='ml.m5.2xlarge', use_large_processing_instance=False, skip_volume_kms=None, processing_source_dir=None, processing_entry_point='missing_value_imputation.py', processing_script_arguments=None, processing_framework_version='1.2-1', label_field, job_type='training', default_numerical_strategy='mean', default_categorical_strategy='mode', default_text_strategy='mode', numerical_constant_value=0.0, categorical_constant_value='Unknown', text_constant_value='Unknown', categorical_preserve_dtype=True, auto_detect_categorical=True, categorical_unique_ratio_threshold=0.1, validate_fill_values=True, exclude_columns=None, column_strategies=None, enable_true_streaming=False, max_workers=0, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for the Missing Value Imputation step with three-tier field categorization. Inherits from ProcessingStepConfigBase.

Fields are categorized into: - Tier 1: Essential User Inputs - Required from users - Tier 2: System Fields - Default values that can be overridden - Tier 3: Derived Fields - Private with read-only property access

label_field: str
processing_entry_point: str
job_type: str
default_numerical_strategy: str
default_categorical_strategy: str
default_text_strategy: str
numerical_constant_value: float
categorical_constant_value: str
text_constant_value: str
categorical_preserve_dtype: bool
auto_detect_categorical: bool
categorical_unique_ratio_threshold: float
validate_fill_values: bool
exclude_columns: List[str] | None
column_strategies: Dict[str, str] | None
enable_true_streaming: bool
max_workers: int
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].

property environment_variables: Dict[str, str]

Get environment variables for the imputation script.

Returns:

Dictionary of environment variables

property effective_exclude_columns: List[str]

Get effective list of columns to exclude from imputation. Combines label_field with user-specified exclude_columns.

Returns:

List of column names to exclude

classmethod validate_label_field(v)[source]

Ensure label_field is a non-empty string.

classmethod validate_entry_point_relative(v)[source]

Ensure processing_entry_point is a non‐empty relative path.

classmethod validate_job_type(v)[source]

Ensure job_type is one of the allowed values.

classmethod validate_numerical_strategy(v)[source]

Ensure default_numerical_strategy is one of the allowed values (case-insensitive).

Matching is case-insensitive and the stored value is normalized to the canonical-cased allowed value.

classmethod validate_categorical_strategy(v)[source]

Ensure default_categorical_strategy is one of the allowed values (case-insensitive).

Matching is case-insensitive and the stored value is normalized to the canonical-cased allowed value.

classmethod validate_text_strategy(v)[source]

Ensure default_text_strategy is one of the allowed values (case-insensitive).

Matching is case-insensitive and the stored value is normalized to the canonical-cased allowed value.

classmethod validate_text_fill_values(v)[source]

Validate that text fill values are pandas-safe.

classmethod validate_exclude_columns(v)[source]

Ensure exclude_columns contains non-empty strings if provided.

classmethod validate_column_strategies(v)[source]

Validate column-specific strategies.

classmethod validate_max_workers(v)[source]

Ensure max_workers is 0 (auto-detect) or a positive integer.

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

get_public_init_fields()[source]

Override get_public_init_fields to include missing value imputation specific fields.

Returns:

Dictionary of field names to values for child initialization

Return type:

Dict[str, Any]

model_dump(**kwargs)[source]

Override model_dump to include derived properties.

get_job_arguments()[source]

CLI args — config is the single source (FZ 31e1d3h).

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.

processing_instance_count: int
processing_volume_size: int
processing_instance_type_large: str
processing_instance_type_small: str
use_large_processing_instance: bool
skip_volume_kms: bool | None
processing_source_dir: str | None
processing_script_arguments: List[str] | None
processing_framework_version: str
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