Skip to content

Commit

Permalink
fix index generation for optimized hist fc with regression models (#2623
Browse files Browse the repository at this point in the history
)

* fix index generation for optimized hist fc with regression models

* update changelog
  • Loading branch information
dennisbader authored Dec 19, 2024
1 parent 71a1902 commit 412d983
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co
- Fixed a bug which raised an error when computing residuals (or backtest with "per time step" metrics) on multiple series with corresponding historical forecasts of different lengths. [#2604](https://github.com/unit8co/darts/pull/2604) by [Dennis Bader](https://github.com/dennisbader).
- Fixed a bug when using `darts.utils.data.tabularization.create_lagged_component_names()` with target `lags=None`, that did not return any lagged target label component names. [#2576](https://github.com/unit8co/darts/pull/2576) by [Dennis Bader](https://github.com/dennisbader).
- Fixed a bug when using `num_samples > 1` with a deterministic regression model and the optimized `historical_forecasts()` method, an exception was not raised. [#2576](https://github.com/unit8co/darts/pull/2588) by [Antoine Madrona](https://github.com/madtoinou).
- Fixed a bug when performing optimized historical forecasts with `RegressionModel` and `last_points_only=False`, where the forecast index generation could result in out-of-bound dates. [#2623](https://github.com/unit8co/darts/pull/2623) by [Dennis Bader](https://github.com/dennisbader).

**Dependencies**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def _optimized_historical_forecasts_all_points(
# TODO: check if faster to create in the loop
new_times = generate_index(
start=hist_fct_start + model.output_chunk_shift * series_.freq,
length=forecast_horizon * stride * forecast.shape[0],
length=forecast_horizon + (forecast.shape[0] - 1) * stride,
freq=freq,
name=series_.time_index.name,
)
Expand Down

0 comments on commit 412d983

Please sign in to comment.