uber / orbit

A Python package for Bayesian forecasting with object-oriented design and probabilistic models under the hood.
https://orbit-ml.readthedocs.io/en/stable/
Other
1.86k stars 132 forks source link

Backtest Scheme Generation with Rolling Window and multiple observations #785

Closed edwinnglabs closed 2 years ago

edwinnglabs commented 2 years ago

Describe the bug It seems to me the rolling window length is compressed automatically (at least the graph shows something like that).

To Reproduce

min_train_len=100
# just some step to make prediction spot more spread
incremental_len=50
forecast_len=84

ex_splitter = TimeSeriesSplitter(df=analysis_data,
                                 min_train_len=min_train_len,
                                 incremental_len=incremental_len,
                                 forecast_len=forecast_len,
                                 n_splits=n_splits,
                                 window_type='rolling',
                                 date_col='order_day')

_ = ex_splitter.plot()

Expected behavior If the rolling window size + forecast_len + (n_splits - 1) * incremental length > total sample size, generate an error message instead.

Screenshots Screen Shot 2022-08-28 at 6 04 44 PM

Environment (please complete the following information):