cursus.steps.configs.config_temporal_feature_engineering_step

Temporal Feature Engineering Configuration with Self-Contained Derivation Logic

This module implements the configuration class for SageMaker Processing steps for temporal feature engineering, 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 TemporalFeatureEngineeringConfig(*, 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='temporal_feature_engineering.py', processing_script_arguments=None, processing_framework_version='1.2-1', sequence_grouping_field, timestamp_field, value_fields, feature_types=['statistical', 'temporal', 'behavioral'], job_type='training', categorical_fields=['merchantCategory', 'paymentMethod'], window_sizes=[7, 14, 30, 90], aggregation_functions=['mean', 'sum', 'std', 'min', 'max', 'count'], lag_features=[1, 7, 14, 30], exponential_smoothing_alpha=0.3, time_unit='days', input_format='numpy', output_format='numpy', enable_distributed_processing=False, chunk_size=5000, max_workers='auto', feature_parallelism=True, cache_intermediate=True, enable_validation=True, missing_value_threshold=0.95, correlation_threshold=0.99, variance_threshold=0.01, outlier_detection=True, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for the Temporal Feature Engineering 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

sequence_grouping_field: str
timestamp_field: str
value_fields: List[str]
feature_types: List[str]
processing_entry_point: str
job_type: str
categorical_fields: List[str]
window_sizes: List[int]
aggregation_functions: List[str]
lag_features: List[int]
exponential_smoothing_alpha: float
time_unit: str
input_format: str
output_format: str
enable_distributed_processing: bool
chunk_size: int
max_workers: str
feature_parallelism: bool
cache_intermediate: bool
enable_validation: bool
missing_value_threshold: float
correlation_threshold: float
variance_threshold: float
outlier_detection: bool
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 dictionary for the processing step.

Returns:

Dictionary of environment variables

classmethod validate_field_names(v)[source]

Ensure field names are non-empty strings.

classmethod validate_value_fields(v)[source]

Ensure value_fields is a non-empty list of non-empty strings.

classmethod validate_feature_types(v)[source]

Ensure feature_types contains valid feature types.

classmethod validate_categorical_fields(v)[source]

Ensure categorical_fields contains valid field names.

classmethod validate_window_sizes(v)[source]

Ensure window_sizes contains positive integers.

classmethod validate_aggregation_functions(v)[source]

Ensure aggregation_functions contains valid function names.

classmethod validate_lag_features(v)[source]

Ensure lag_features contains positive integers.

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_time_unit(v)[source]

Ensure time_unit is valid (case-insensitive).

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

classmethod validate_formats(v)[source]

Ensure input/output formats are valid (case-insensitive).

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

classmethod validate_max_workers(v)[source]

Ensure max_workers is ‘auto’ or a positive integer string.

classmethod validate_alpha(v)[source]

Ensure exponential_smoothing_alpha is between 0.0 and 1.0.

classmethod validate_thresholds(v)[source]

Ensure thresholds are between 0.0 and 1.0.

classmethod validate_variance_threshold(v)[source]

Ensure variance_threshold is non-negative.

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

get_public_init_fields()[source]

Override get_public_init_fields to include temporal feature engineering 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.