cursus.steps.configs.config_active_sample_selection_step¶
Active Sample Selection Step Configuration
This module implements the configuration class for the Active Sample Selection step using a self-contained design where derived fields are private with read-only properties. Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)
- class ActiveSampleSelectionConfig(*, 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='active_sample_selection.py', processing_script_arguments=None, processing_framework_version='1.2-1', use_case, id_field, label_field, score_field, selection_strategy='confidence_threshold', output_format='csv', confidence_threshold=0.9, k_per_class=100, max_samples=0, uncertainty_mode='margin', batch_size=32, metric='euclidean', random_seed=42, score_field_prefix='prob_class_', job_type='ssl_selection', **extra_data)[source]¶
Bases:
ProcessingStepConfigBaseConfiguration for Active Sample Selection step.
Supports both Semi-Supervised Learning (SSL) and Active Learning workflows with Pydantic validation to prevent strategy misuse.
Three-Tier Configuration: - Tier 1: Essential User Inputs (none - all have defaults) - Tier 2: System Fields with Defaults (all selection parameters) - Tier 3: Derived Fields (inherited from ProcessingStepConfigBase)
- selection_strategy: Literal['confidence_threshold', 'top_k_per_class', 'uncertainty', 'diversity', 'badge']¶
- 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].
- classmethod validate_strategy(v)[source]¶
Validate selection 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_use_case(v)[source]¶
Validate use case 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_output_format(v)[source]¶
Validate output format (case-insensitive).
Matching is case-insensitive and the stored value is normalized to the canonical-cased allowed value.
- validate_strategy_use_case_compatibility()[source]¶
⚠️ CRITICAL: Validate strategy is compatible with use case.
This cross-field validation prevents: - Using uncertainty strategies for SSL (creates noisy pseudo-labels) - Using confidence strategies for Active Learning (wastes human effort)
- Raises:
ValueError – If strategy is incompatible with use_case
- get_public_init_fields()[source]¶
Override get_public_init_fields to include selection-specific fields. Gets a dictionary of public fields suitable for initializing a child config.
- Returns:
Dictionary of field names to values for child initialization
- Return type:
Dict[str, Any]
- 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.