You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We decided that we want to enable passing context into forecast method of the model. It will be done with a new parameter: prediction_size. First n - prediction_size points in a given ts won't be forecasted and if model needs a context, it will use this points for this.
Proposal
Add prediction_size parameter for the adapters.
implement separately common logic on selection of last prediction_size elements of prediction
Add prediction_size parameter to forecast method in classes:
base.Model
base.ForecastAbstractModel
base.PredictIntervalAbstractModel
base.PerSegmentModel -- determine the context needed for prediction and pass it into the adapter in df_context parameter, if context isn't needed don't pass df_context.
base.PerSegmentPredictionIntervalModel -- same as above
base.MultiSegmentModel -- same as above
base.DeepBaseAbstractModel -- rename horizon to prediction_size
base.DeepBaseModel -- rename horizon to prediction_size
add to other classes if it wasn't enough
default value should be None and in the body of the function correct value is determined as a maximum possible prediction_size
if a too big prediction_size is set (not enough context) throw an error
Fix forecast in pipelines to work with context
Fix Pipeline.forecast, the code should be similar to snippet with DeepBaseModel
Fix AutoRegressivePipeline.forecast
Fix ensembles.
Test cases
Make sure current tests pass.
Test function on selection of last prediction_size elements for adapters.
Test that if prediction_size is None then value is determined as len(df) - context_size. Probably, it is convenient to do with some dummy/mock model.
Test that models throw error if prediction_size is too big. Look above about dummy/mock.
Test that Pipeline.forecast passes big enough dataset according to `horizon. Look above about dummy/mock.
Test that AutoRegressivePipeline.forecast passes big enough dataset according to horizon. Look above about dummy/mock.
🚀 Feature Request
We decided that we want to enable passing context into
forecast
method of the model. It will be done with a new parameter:prediction_size
. Firstn - prediction_size
points in a givents
won't be forecasted and if model needs a context, it will use this points for this.Proposal
prediction_size
parameter for the adapters.prediction_size
elements of predictionprediction_size
parameter toforecast
method in classes:base.Model
base.ForecastAbstractModel
base.PredictIntervalAbstractModel
base.PerSegmentModel
-- determine the context needed for prediction and pass it into the adapter indf_context
parameter, if context isn't needed don't passdf_context
.base.PerSegmentPredictionIntervalModel
-- same as abovebase.MultiSegmentModel
-- same as abovebase.DeepBaseAbstractModel
-- renamehorizon
toprediction_size
base.DeepBaseModel
-- renamehorizon
toprediction_size
None
and in the body of the function correct value is determined as a maximum possibleprediction_size
prediction_size
is set (not enough context) throw an errorforecast
in pipelines to work with contextPipeline.forecast
, the code should be similar to snippet withDeepBaseModel
AutoRegressivePipeline.forecast
Test cases
prediction_size
elements for adapters.prediction_size is None
then value is determined aslen(df) - context_size
. Probably, it is convenient to do with some dummy/mock model.prediction_size
is too big. Look above about dummy/mock.Pipeline.forecast
passes big enough dataset according to `horizon. Look above about dummy/mock.AutoRegressivePipeline.forecast
passes big enough dataset according tohorizon
. Look above about dummy/mock.Additional context
inference
branch.The text was updated successfully, but these errors were encountered: