cursus.steps.configs.config_risk_table_mapping_step

Configuration for Risk Table Mapping Processing Step.

This module defines the configuration class for the risk table mapping processing step, which is responsible for creating and applying risk tables for categorical features.

After Phase 6 refactor: Hyperparameters are now embedded in the source directory, eliminating the need for S3 upload logic and hyperparameters_s3_uri field.

class RiskTableMappingConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', image_uri=None, subnets=None, security_group_ids=None, enable_network_isolation=None, 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='risk_table_mapping.py', processing_script_arguments=None, processing_framework_version='1.2-1', job_type='training', cat_field_list=[], label_name='target', smooth_factor=0.01, count_threshold=5, max_unique_threshold=100, enable_true_streaming=False, max_workers=0, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for Risk Table Mapping Processing Step.

This class extends ProcessingStepConfigBase to include specific fields for risk table mapping, including categorical fields and job type.

Source Directory Integration: After Phase 6 refactor, hyperparameters are embedded in the source directory structure and no longer require separate S3 upload. The expected source directory structure is:

source_dir/ ├── risk_table_mapping.py # Main script (entry point) └── hyperparams/ # Hyperparameters directory

└── hyperparameters.json # Generated hyperparameters file

The hyperparameters.json file is automatically generated from the configuration fields (cat_field_list, label_name, smooth_factor, count_threshold) and embedded in the source directory for runtime access.

processing_entry_point: str
job_type: str
cat_field_list: List[str]
label_name: str
smooth_factor: float
count_threshold: int
max_unique_threshold: int
enable_true_streaming: bool
max_workers: int
property environment_variables: Dict[str, str]

Get environment variables for the risk table mapping script.

Returns:

Dictionary of environment variables

classmethod validate_max_workers(v)[source]

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

classmethod validate_job_type(v)[source]

Validate job type is one of the allowed values.

validate_risk_table_config()[source]

Validate risk table mapping configuration.

After Phase 6 refactor: Simplified validation focusing on core configuration without S3 upload logic or external hyperparameters handling.

get_job_arguments()[source]

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

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].

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.