Skip to content

Add hyperparameter-searchable Time Series Forecasting Pipeline#23

Open
himelds wants to merge 4 commits intoSimonBlanke:mainfrom
himelds:feat/timeseries-forecasting-pipeline
Open

Add hyperparameter-searchable Time Series Forecasting Pipeline#23
himelds wants to merge 4 commits intoSimonBlanke:mainfrom
himelds:feat/timeseries-forecasting-pipeline

Conversation

@himelds
Copy link
Copy Markdown

@himelds himelds commented Apr 22, 2026

Description

This PR introduces a flexible, hyperparameter-searchable time series forecasting pipeline. It allows for automated search over feature engineering parameters (lags, rolling windows, differencing), preprocessing scalers, and various machine learning models (Ridge, Random Forest, Gradient Boosting).

Related Issues

Fixes #20

Type of Change

  • [ENH] - New feature (non-breaking change adding functionality)

How was this solved?

  1. Feature Engineering: Implemented a vectorized apply_time_series_features function using sliding_window_view for efficient lag and rolling statistics extraction.
  2. Flexible Pipeline: Created TimeSeriesPipelineForecasterFunction that integrates data loading, chronological splitting (80/20 train/test), and model selection.
  3. Model Selection: Added support for Ridge, RandomForest, and GradientBoosting with a shared model__regularization parameter mapped to model-specific hyperparameters (alpha, max_depth, learning_rate).
  4. Error Handling: Implemented robust error handling to return -inf for invalid parameter combinations, ensuring optimizer stability.

Checklist

Required

  • PR title includes appropriate tag: [ENH]
  • Code passes make check (lint, format, isort)

Tests

  • Tests added/updated for changes

Documentation

  • Documentation added/updated (docstrings)

Testing

  1. Verified with a manual test script on the airline dataset (Score: ~ -39.75).
  2. Verified on the energy dataset using GradientBoosting (Score: ~ -9.33).
  3. Ran formal pytest covering basic execution and invalid configuration handling (all tests passed).

Additional Notes

  • The objective function returns Negative MAE, making it compatible with maximizing optimizers.
  • Uses a chronological split to maintain the temporal integrity of the data.

@SimonBlanke
Copy link
Copy Markdown
Owner

thanks for opening the PR. Please check the existing tests and look into how to add this new test-function to the tests.

Copy link
Copy Markdown
Owner

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick review pass. Please add testing :-)

@himelds
Copy link
Copy Markdown
Author

himelds commented Apr 25, 2026

Hi @SimonBlanke,
I've updated the PR based on your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] add time-series forecasting pipeline test-function

2 participants