Skip to content

[ENH] re-factoring forecaster update, update_predict, update_predict_single #982

@fkiraly

Description

@fkiraly

The rolling prediction interface of forecasters is currently confusing and unintuitive.

I suggest we re-factor this as follows:

  • update remains as is currently
  • update_predict becomes what update_predict_single is currently, a short-hand for "one update then one predict
  • current functionality in update_predict gets replaced by an update_predict_playback, as below.

update_predict_playback(y, cutoffs, X=None, fh=None, update_params=True) -> list

y is the full series; cutoffs (a list of indices) are indices on the same axis as y (but not necessarily a sub-set of y.index).
It is assumed (and asserted/tested) that cutoff is monotonous. fh must be relative.

The return is a list of same length as cutoffs; the 0-th element is the return of predict after fit to y[:cutoffs[0]] (temporal slice); the i-th element is the return of the i-th update_predict, with y[cutoffs[i-1]:cutoffs[i]].
All predictions are with the fh passed.

Metadata

Metadata

Assignees

Labels

API designAPI design & software architecturemodule:forecastingforecasting module: forecasting, incl probabilistic and hierarchical forecasting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions