Pipeline¶
- class Pipeline(model: Union[etna.models.base.PerSegmentModel, etna.models.base.PerSegmentPredictionIntervalModel, etna.models.base.MultiSegmentModel], transforms: Sequence[etna.transforms.base.Transform] = (), horizon: int = 1)[source]¶
Bases:
etna.pipeline.base.BasePipeline
Pipeline of transforms with a final estimator.
Create instance of Pipeline with given parameters.
- Parameters
model (Union[etna.models.base.PerSegmentModel, etna.models.base.PerSegmentPredictionIntervalModel, etna.models.base.MultiSegmentModel]) – Instance of the etna Model
transforms (Sequence[etna.transforms.base.Transform]) – Sequence of the transforms
horizon (int) – Number of timestamps in the future for forecasting
- Inherited-members
Methods
backtest
(ts, metrics[, n_folds, mode, ...])Run backtest with the pipeline.
fit
(ts)Fit the Pipeline.
forecast
([prediction_interval, quantiles, ...])Make predictions.
- fit(ts: etna.datasets.tsdataset.TSDataset) etna.pipeline.pipeline.Pipeline [source]¶
Fit the Pipeline.
Fit and apply given transforms to the data, then fit the model on the transformed data.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – Dataset with timeseries data
- Returns
Fitted Pipeline instance
- Return type
- forecast(prediction_interval: bool = False, quantiles: Sequence[float] = (0.025, 0.975), n_folds: int = 3) etna.datasets.tsdataset.TSDataset [source]¶
Make predictions.
- Parameters
prediction_interval (bool) – If True returns prediction interval for forecast
quantiles (Sequence[float]) – Levels of prediction distribution. By default 2.5% and 97.5% taken to form a 95% prediction interval
n_folds (int) – Number of folds to use in the backtest for prediction interval estimation
- Returns
Dataset with predictions
- Return type