darts icon indicating copy to clipboard operation
darts copied to clipboard

Feat/shifted output

Open dennisbader opened this issue 1 year ago • 3 comments

Work in progress

Fixes #2139, fixes #2132

Summary

  • adds support for shifting the output chunk of global models with parameter output_chunk_shift
  • add support to regression models
  • fixes bug when using regression models with lags=None and future_covariates with positive only lags and future_covariates starting at or after the first predictable time step.
  • parametrize most of the tabularization unit tests
  • introduces new helper function darts.utils.utils.n_steps_between() to efficiently compute the number of time steps (periods) between two points/timestamps with a given frequency -> improves efficiency for regression model tabularization by avoiding pd.date_range().

dennisbader avatar Jan 20 '24 14:01 dennisbader

Codecov Report

Attention: Patch coverage is 97.18310% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 93.96%. Comparing base (b9e6d8b) to head (bfade00).

Files Patch % Lines
darts/utils/utils.py 84.61% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2176      +/-   ##
==========================================
+ Coverage   93.88%   93.96%   +0.08%     
==========================================
  Files         135      135              
  Lines       13467    13487      +20     
==========================================
+ Hits        12643    12673      +30     
+ Misses        824      814      -10     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 21 '24 13:01 codecov-commenter

Tried this version, and the shift output function works well, but the RNN models cannot work for some reason,

where I got message below ``` WARNING:darts.models.forecasting.rnn_model:ignoring user defined output_chunk_length. RNNModel uses a fixed output_chunk_length=1. WARNING:darts.models.forecasting.rnn_model:ignoring user defined output_chunk_shift. RNNModel uses a fixed output_chunk_shift=0.

noahvand avatar Jan 26 '24 20:01 noahvand

Hi @noahvand,

This is intentional because by definition RNNModel enforces output_chunk_length=1 and the hidden state mechanism is not really compatible with "gaps" between input values and forecast: introducing such a shift would require the RNNModel to still forecast output_chunk_shift values before getting to the actual value of interest.

For the sake of uniform API, we could change this but RNNModel is kind of already in its own category anyway.

madtoinou avatar Feb 01 '24 13:02 madtoinou