PredictionIntervalContextRequiredAbstractModel¶
- class PredictionIntervalContextRequiredAbstractModel[source]¶
Bases:
etna.models.base.AbstractModel
Interface for models that support prediction intervals and need context for prediction.
- Inherited-members
Methods
fit
(ts)Fit model.
forecast
(ts, prediction_size[, ...])Make predictions.
get_model
()Get internal model/models that are used inside etna class.
load
(path)Load an object.
params_to_tune
()Get grid for tuning hyperparameters.
predict
(ts, prediction_size[, ...])Make predictions with using true values as autoregression context if possible (teacher forcing).
save
(path)Save the object.
set_params
(**params)Return new object instance with modified parameters.
to_dict
()Collect all information about etna object in dict.
Attributes
context_size
Context size of the model.
- abstract forecast(ts: etna.datasets.tsdataset.TSDataset, prediction_size: int, prediction_interval: bool = False, quantiles: Sequence[float] = (0.025, 0.975), return_components: bool = False) etna.datasets.tsdataset.TSDataset [source]¶
Make predictions.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – Dataset with features
prediction_size (int) – Number of last timestamps to leave after making prediction. Previous timestamps will be used as a context for models that require it.
prediction_interval (bool) – If True returns prediction interval for forecast
quantiles (Sequence[float]) – Levels of prediction distribution. By default 2.5% and 97.5% are taken to form a 95% prediction interval
return_components (bool) – If True additionally returns forecast components
- Returns
Dataset with predictions
- Return type
- abstract predict(ts: etna.datasets.tsdataset.TSDataset, prediction_size: int, prediction_interval: bool = False, quantiles: Sequence[float] = (0.025, 0.975), return_components: bool = False) etna.datasets.tsdataset.TSDataset [source]¶
Make predictions with using true values as autoregression context if possible (teacher forcing).
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – Dataset with features
prediction_size (int) – Number of last timestamps to leave after making prediction. Previous timestamps will be used as a context for models that require it.
prediction_interval (bool) – If True returns prediction interval for forecast
quantiles (Sequence[float]) – Levels of prediction distribution. By default 2.5% and 97.5% are taken to form a 95% prediction interval
return_components (bool) – If True additionally returns prediction components
- Returns
Dataset with predictions
- Return type