Extract the training series and exogenous slices for one target column.
Clips the target column of df_pipeline to the training window defined by config.start_train_ts and config.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.
DataFrame with a tz-aware :class:~pandas.DatetimeIndex containing all target columns produced by the preprocessing pipeline.
required
config
'ConfigMulti'
Pipeline configuration object. Must have the following attributes set before calling this function: - start_train_ts — inclusive start of the training window (:class:~pandas.Timestamp, tz-aware). - end_train_ts — inclusive end of the training window (:class:~pandas.Timestamp, tz-aware). - use_exogenous_features — bool flag controlling whether exogenous features are used.
Merged DataFrame of target and exogenous columns covering at least [config.start_train_ts, config.end_train_ts]. 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 (config.end_train_ts, config.cov_end]. Required when data_with_exog is not None. Pass None (default) when exogenous features are disabled.
- y_train — 1-D Series with the target values over the training window [config.start_train_ts, config.end_train_ts], squeezed to a plain :class:~pandas.Series.
- 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: