API Reference

This is the class and function reference for pmdarima. Please refer to the full user guide for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.

pmdarima.arima: ARIMA estimator & differencing tests

The pmdarima.arima sub-module defines the ARIMA estimator and the auto_arima function, as well as a set of tests of seasonality and stationarity.

ARIMA estimator & statistical tests

User guide: See the Estimating the seasonal differencing term, D and Enforcing stationarity sections for further details.

arima.ADFTest([alpha, k]) Conduct an ADF test for stationarity.
arima.ARIMA(order[, seasonal_order, …]) An ARIMA estimator.
arima.AutoARIMA([start_p, d, start_q, …]) Automatically discover the optimal order for an ARIMA model.
arima.CHTest(m) Conduct a CH test for seasonality.
arima.KPSSTest([alpha, null, lshort]) Conduct a KPSS test for stationarity.
arima.OCSBTest(m[, lag_method, max_lag]) Perform an OCSB test of seasonality.
arima.PPTest([alpha, lshort]) Conduct a PP test for stationarity.
arima.StepwiseContext([max_steps, max_dur]) Context manager to capture runtime context for stepwise mode.

ARIMA auto-parameter selection

User guide: See the Tips to using auto_arima section for further details.

arima.auto_arima(y[, X, start_p, d, …]) Automatically discover the optimal order for an ARIMA model.

Differencing helpers

arima.is_constant(x) Test x for constancy.
arima.ndiffs(x[, alpha, test, max_d]) Estimate ARIMA differencing term, d.
arima.nsdiffs(x, m[, max_D, test]) Estimate the seasonal differencing term, D.

Seasonal decomposition

arima.decompose(x, type_, m[, filter_]) Decompose the time series into trend, seasonal, and random components.

pmdarima.datasets: Toy timeseries datasets

The pmdarima.datasets submodule provides several different univariate time- series datasets used in various examples and tests across the package. If you would like to prototype a model, this is a good place to find easy-to-access data.

User guide: See the Toy time-series datasets section for further details.

Dataset loading functions

datasets.load_airpassengers([as_series, dtype]) Monthly airline passengers.
datasets.load_ausbeer([as_series, dtype]) Quarterly beer production data.
datasets.load_austres([as_series, dtype]) Quarterly residential data.
datasets.load_gasoline([as_series, dtype]) Weekly US finished motor gasoline products
datasets.load_heartrate([as_series, dtype]) Uniform heart-rate data.
datasets.load_lynx([as_series, dtype]) Annual numbers of lynx trappings for 1821–1934 in Canada.
datasets.load_msft() Load the microsoft stock data
datasets.load_sunspots([as_series, dtype]) Monthly Sunspot Numbers, 1749 - 1983
datasets.load_taylor([as_series, dtype]) Half-hourly electricity demand
datasets.load_wineind([as_series, dtype]) Australian total wine sales by wine makers in bottles <= 1 litre.
datasets.load_woolyrnq([as_series, dtype]) Quarterly production of woollen yarn in Australia.

pmdarima.metrics: Time-series metrics

The metrics submodule implements time-series metrics that are not implemented in scikit-learn.

Metrics

metrics.smape(y_true, y_pred) Compute the Symmetric Mean Absolute Percentage Error.

pmdarima.model_selection: Cross-validation classes

The pmdarima.model_selection submodule defines several different strategies for cross-validating time series models

Cross validation & split utilities

model_selection.RollingForecastCV([h, step, …]) Use a rolling forecast to perform cross validation
model_selection.SlidingWindowForecastCV([h, …]) Use a sliding window to perform cross validation
model_selection.check_cv([cv]) Input checker utility for building a cross-validator
model_selection.cross_validate(estimator, y) Evaluate metric(s) by cross-validation and also record fit/score times.
model_selection.cross_val_predict(estimator, y) Generate cross-validated estimates for each input data point
model_selection.cross_val_score(estimator, y) Evaluate a score by cross-validation
model_selection.train_test_split(*arrays[, …]) Split arrays or matrices into sequential train and test subsets

pmdarima.pipeline: Pipelining transformers & ARIMAs

With the pipeline.Pipeline class, we can pipeline transformers together and into a final ARIMA stage.

Pipelines

pipeline.Pipeline(steps) A pipeline of transformers with an optional final estimator stage

pmdarima.preprocessing: Preprocessing transformers

The pmdarima.preprocessing submodule provides a number of transformer classes for pre-processing time series or exogenous arrays.

Endogenous transformers

preprocessing.BoxCoxEndogTransformer([…]) Apply the Box-Cox transformation to an endogenous array
preprocessing.LogEndogTransformer([lmbda, …]) Apply a log transformation to an endogenous array

Exogenous transformers

preprocessing.DateFeaturizer(column_name[, …]) Create exogenous date features
preprocessing.FourierFeaturizer(m[, k, prefix]) Fourier terms for modeling seasonality

pmdarima.utils: Utilities

Utilities and array differencing functions used commonly across the package.

Array helper functions & metaestimators

utils.acf(x[, unbiased, nlags, qstat, fft, …]) Calculate the autocorrelation function.
utils.as_series(x) Cast as pandas Series.
utils.c(*args) Imitates the c function from R.
utils.check_endog(y[, dtype, copy, …]) Wrapper for check_array and column_or_1d from sklearn
utils.check_exog(X[, dtype, copy, …]) A wrapper for check_array for 2D arrays
utils.diff(x[, lag, differences]) Difference an array.
utils.diff_inv(x[, lag, differences, xi]) Inverse the difference of an array.
utils.if_has_delegate(delegate) Wrap a delegated instance attribute function.
utils.is_iterable(x) Test a variable for iterability.
utils.pacf(x[, nlags, method, alpha]) Partial autocorrelation estimate.

Plotting utilities & wrappers

utils.autocorr_plot(series[, show]) Plot a series’ auto-correlation.
utils.decomposed_plot(decomposed_tuple[, …]) Plot the decomposition of a time series.
utils.plot_acf(series[, ax, lags, alpha, …]) Plot a series’ auto-correlation as a line plot.
utils.plot_pacf(series[, ax, lags, alpha, …]) Plot a series’ partial auto-correlation as a line plot.