Extract the training series and exogenous slices for one target column.
Clips the target column of df_pipeline to the training window defined by start_train_ts and end_train_ts. When exogenous features are enabled (config.use_exogenous_features is True) and data_with_exog is provided, the matching exogenous training slice and forecast-horizon slice are also returned; otherwise both are None.
This function is the canonical way to extract per-target data from the shared pipeline state so that outlier removal, imputation, and feature engineering are applied consistently across all forecasting tasks.
The training-window timestamps are supplied as explicit parameters so that this helper stays decoupled from RunState (ADR adr-multitask-configmulti-merge, step 5). Both parameters are required; passing None raises ValueError.
Merged DataFrame of target and exogenous columns covering at least the training window. Required when config.use_exogenous_features is True. Pass None (default) to skip exogenous slicing.
Column names to select from data_with_exog and exo_pred. Required when data_with_exog is not None. Pass None (default) when exogenous features are disabled.
Exogenous feature DataFrame covering the forecast horizon. Required when data_with_exog is not None. Pass None (default) when exogenous features are disabled.
Inclusive start of the training window (tz-aware pd.Timestamp). Keyword-only, required — pass task.run_state.start_train_ts after the pipeline has been prepared. Passing None raises ValueError.
Inclusive end of the training window (tz-aware pd.Timestamp). Keyword-only, required — pass task.run_state.end_train_ts after the pipeline has been prepared. Passing None raises ValueError.
- exog_train — DataFrame of selected exogenous features over the training window, cast to float32. None when exogenous features are disabled or data_with_exog is None.
- exog_future — DataFrame of selected exogenous features covering the forecast horizon, cast to float32. None when exogenous features are disabled or exo_pred is None.
Examples
Extract training data for a single target without exogenous features: