Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX-2633: Use correct time indices when running historical forecasts with output_chunk_shift in regression models #2634

Merged
merged 5 commits into from
Dec 31, 2024

Conversation

MattiasDC
Copy link
Contributor

@MattiasDC MattiasDC commented Dec 26, 2024

…on regression models with 'output_chunk_shift > 0' and 'output_chunk_length == 1'. Extended unit tests to cover this

Checklist before merging this PR:

  • Mentioned all issues that this PR fixes or addresses.
  • Summarized the updates of this PR under Summary.
  • Added an entry under Unreleased in the Changelog.

Fixes #2633.

Summary

When creating historical forecasts using the optimized version, use the correct time indices when output_chunk_shift > 0 and output_chunk_length == 1. Extended the unit tests to cover this case

Other Information

…on regression models with 'output_chunk_shift > 0' and 'output_chunk_length == 1'. Extended unit tests to cover this
if (
stride == 1
and model.output_chunk_length == 1
and model.output_chunk_shift == 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This if-check is extended with an additional condition, which fixes the issue.

@MattiasDC MattiasDC changed the title FIX-2633: Use correct time indices when running historical forecasts … FIX-2633: Use correct time indices when running historical forecasts with output_chunk_shift in regression models Dec 26, 2024
Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

Thanks @MattiasDC for finding and fixing this bug! It's greatly appreciated :)
PR also looks great. I made some changes to the tests (the bounds were not correct, but we didn't properly check that before) and updated the changelog.

I'll merge once all tests have passed. Thanks again 🚀

@MattiasDC
Copy link
Contributor Author

I'm on my phone now, but you have a typo in test comments 'sampels' iso 'samples'

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.19%. Comparing base (aad1440) to head (d37c0d5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2634      +/-   ##
==========================================
- Coverage   94.24%   94.19%   -0.06%     
==========================================
  Files         141      141              
  Lines       15463    15466       +3     
==========================================
- Hits        14573    14568       -5     
- Misses        890      898       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dennisbader dennisbader merged commit b441192 into unit8co:master Dec 31, 2024
9 checks passed
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.

[BUG] optimized historical_forecasts has incorrect time indices under certain conditions
2 participants