cursus.steps.scripts.temporal_feature_engineering¶
Temporal Feature Engineering Script
This script extracts comprehensive temporal features from normalized sequence data, combining generic temporal features with time window aggregations. Designed to consume the output from temporal_sequence_normalization and produce rich temporal features for machine learning models.
Supports configurable feature types, time windows, and processing strategies.
- load_normalized_sequences(input_dir, input_format='numpy', logger=None)[source]¶
Load normalized sequences from TemporalSequenceNormalization output.
- Parameters:
- Returns:
“categorical”: Categorical sequence arrays
”numerical”: Numerical sequence arrays
”categorical_attention_mask”: Attention masks for categorical data
”numerical_attention_mask”: Attention masks for numerical data
”metadata”: Loaded metadata dictionary
- Return type:
Dictionary containing
- validate_input_data(normalized_data, logger=None)[source]¶
Validate the structure of normalized sequence data.
- class GenericTemporalFeaturesOperation(config, logger=None)[source]¶
Bases:
objectExtracts generic temporal features from normalized sequences.
Extracted from TSA feature engineering requirements and general temporal modeling needs.
- class TimeWindowAggregationsOperation(config, logger=None)[source]¶
Bases:
objectComputes time window aggregations for multi-scale temporal analysis.
Extracted from TSA time window feature requirements and temporal modeling needs.
- class FeatureQualityController(config, logger=None)[source]¶
Bases:
objectComprehensive feature quality control and validation framework.
Ensures engineered features meet quality standards for model consumption.
- save_temporal_feature_tensors(feature_tensors, output_dir, output_format='numpy', logger=None)[source]¶
Save temporal feature tensors in the specified format.
- main(input_paths, output_paths, environ_vars, job_args, logger=None)[source]¶
Main logic for temporal feature engineering.
- Parameters:
input_paths (Dict[str, str]) – Dictionary of input paths with logical names
output_paths (Dict[str, str]) – Dictionary of output paths with logical names
environ_vars (Dict[str, str]) – Dictionary of environment variables
job_args (Namespace) – Command line arguments
logger (Callable[[str], None] | None) – Optional logger object (defaults to print if None)
- Returns:
Dictionary of temporal feature tensors
- Return type: