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

Refactor/hist fc general #1801

Merged
merged 10 commits into from May 28, 2023
Merged

Refactor/hist fc general #1801

merged 10 commits into from May 28, 2023

Conversation

dennisbader
Copy link
Collaborator

@dennisbader dennisbader commented May 27, 2023

Summary

This is the first part of improving historical forecasting:

  • general improvement to historical forecasting for all models.
  • improved efficiency for TimeSeries.slice(), *.drop_before(), and *.drop_after()

This PR reduces the TimeSeries preprocessing time in historical forecasting for all models. Below are the result from old (original) hist fc against new implementation for integer- and datetime indexed series (retrain=False):

type process time: integer indexed [s] process time: dt indexed [s]
old single series (1 series * 10'000 iter) 18.26 73.13
new single series (1 series * 10'000 iter) 9.37 26.93
old multi series (10'000 series * 1 iter) 30.42 114.22
new multi series (10'000 series * 1 iter) 20.47 78.50

@dennisbader dennisbader requested a review from hrzn as a code owner May 27, 2023 12:30
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.12 ⚠️

Comparison is base (c03c404) 94.25% compared to head (2373f29) 94.13%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1801      +/-   ##
==========================================
- Coverage   94.25%   94.13%   -0.12%     
==========================================
  Files         125      125              
  Lines       11619    11604      -15     
==========================================
- Hits        10951    10923      -28     
- Misses        668      681      +13     
Impacted Files Coverage Δ
darts/models/forecasting/forecasting_model.py 95.36% <100.00%> (+0.17%) ⬆️
darts/timeseries.py 92.38% <100.00%> (-0.22%) ⬇️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dennisbader dennisbader merged commit 75521fb into master May 28, 2023
9 checks passed
@dennisbader dennisbader deleted the refactor/hist_fc_general branch May 28, 2023 18:11
alexcolpitts96 pushed a commit to alexcolpitts96/darts that referenced this pull request May 31, 2023
* simple time reduction from removing redundant slicing

* move the min_start_time truncation out of the loop

* replace self by model to allow for moving historical forecasts out of ForecastingModel

* replace series.drop_*() with series.slice() for performance boost

* make same state as test

* optimize some time series methods

* used improved splitting in historical forecasts

* Update CHANGELOG.md
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.

None yet

2 participants