pmdarima.pipeline.Pipeline

class pmdarima.pipeline.Pipeline(steps)[source][source]

A pipeline of transformers with an optional final estimator stage

The pipeline object chains together an arbitrary number of named, ordered transformations, passing the output from one as the input to the next. As the last stage, an ARIMA or AutoARIMA object will be fit. This pipeline takes after the scikit-learn sklearn.Pipeline object, which behaves similarly but does not share the same time-series interface that pmdarima follows.

The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. For this, it enables setting parameters of the various steps using their names and the parameter name separated by a ‘__’, as in the example below.

Parameters:

steps : list

List of (name, transform) tuples (implementing fit/transform) that are chained, in the order in which they are chained, with the last object an ARIMA or AutoARIMA estimator.

Attributes

named_steps

Map the steps to a dictionary

Examples

>>> from pmdarima.datasets import load_wineind
>>> from pmdarima.arima import AutoARIMA
>>> from pmdarima.pipeline import Pipeline
>>> from pmdarima.preprocessing import FourierFeaturizer
>>>
>>> wineind = load_wineind()
>>> pipeline = Pipeline([
...     ("fourier", FourierFeaturizer(m=12, k=3)),
...     ("arima", AutoARIMA(seasonal=False, stepwise=True,
...                         suppress_warnings=True,
...                         error_action='ignore'))
... ])
>>> pipeline.fit(wineind)
Pipeline(steps=[('fourier', FourierFeaturizer(k=3, m=12)),
                ('arima', AutoARIMA(D=None, alpha=0.05, callback=None,
                                    d=None, disp=0, error_action='ignore',
                                    information_criterion='aic', m=1,
                                    max_D=1, max_P=2, max_Q=2, max_d=2,
                                    max_order=10, max_p=5, max_q=5,
                                    maxiter=None, method=None,
                                    n_fits=10, n...s_warnings=True,
                                    test='kpss', trace=False,
                                    transparams=True, trend=None,
                                    with_intercept=True))])

Methods

fit(y[, X])

Fit the pipeline of transformers and the ARIMA model

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict([n_periods, X, return_conf_int, ...])

Forecast future (transformed) values

predict_in_sample([X, start, end, dynamic, ...])

Generate in-sample predictions from the fit pipeline.

set_params(**params)

Set the parameters of this estimator.

set_predict_request(*[, alpha, ...])

Request metadata passed to the predict method.

set_transform_request(*[, n_periods])

Request metadata passed to the transform method.

summary()

Get a summary of the ARIMA model

transform([n_periods, X])

Get the transformed X array

update(y[, X, maxiter])

Update an ARIMA or auto-ARIMA as well as any necessary transformers

__init__(steps)[source][source]

Examples using pmdarima.pipeline.Pipeline

Pipelines with auto_arima

Pipelines with auto_arima

Modeling quasi-seasonal trends with date features

Modeling quasi-seasonal trends with date features