# pmdarima wraps statsmodels in a scikit-learn shaped interface for ARIMA forecasting

> pmdarima gives Python users the equivalent of R's auto.arima, plus transformers, pipelines and cross-validation tools that plug into a scikit-learn style workflow. It sits on top of statsmodels rather than replacing it, and the fit interface is where most of the value is.

**alkaline-ml/pmdarima** — A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.

- Repository: https://github.com/alkaline-ml/pmdarima
- Website: https://www.alkaline-ml.com/pmdarima
- Stars: 1,740 · Forks: 258
- Language: Python
- License: MIT
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/alkaline-ml-pmdarima

## The gap it fills is R's forecast package, not statsmodels

Python users can use pmdarima as an equivalent of R's auto.arima.

pmdarima exists to close that gap. Its own description calls it a statistical library designed to fill the void in Python's time series analysis capabilities, and the feature list names the equivalent of R's auto.arima first.

The architectural point matters more than the feature list. pmdarima wraps statsmodels under the hood but presents a scikit-learn shaped interface, so estimators have fit and predict, transformers compose, and pipelines string stages together. That is why the same library can offer both a one call search and a serialisable production pipeline without two separate mental models.

## Installing from pip, and what happens when no wheel exists

The ordinary install is one line, and PyPI carries binary and source distributions for Windows, Mac and Linux manylinux:

```bash
pip install pmdarima
```

Wheels are published for Python 3.10 and newer on 64-bit Mac, 64-bit manylinux Linux and 64-bit Windows. 32-bit wheels exist only for versions below 2.0.0 combined with Python below 3.10, which is the practical end of that path.

The fallback is not graceful. If no wheel matches, pip builds from the source distribution, and the README says you will need cython>=0.29 and gcc on Mac and Linux, or MinGW on Windows. The pyproject.toml confirms this is a compiled build: the build backend is meson-python, and the build requirements list numpy>=2.0.0 alongside cython, with two specific cython versions excluded.

Conda users get Mac and Linux builds through conda-forge:

```bash
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install pmdarima
```

The project states it does not maintain those binaries itself; they come from the conda-forge pmdarima-feedstock repository, which is where distribution specific problems belong.

## A first fit on the wineind dataset, split before the model sees anything

The quickstart splits the series before fitting, which is the pattern the library wants you to follow. load_wineind is one of the built-in datasets, which is the fastest way to see the whole loop without touching a CSV:

```python
import pmdarima as pm
from pmdarima.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt

# Load/split your data
y = pm.datasets.load_wineind()
train, test = train_test_split(y, train_size=150)

# Fit your model
model = pm.auto_arima(train, seasonal=True, m=12)

# make your forecasts
forecasts = model.predict(test.shape[0])  # predict N steps into the future

# Visualize the forecasts (blue=train, green=forecasts)
x = np.arange(y.shape[0])
plt.plot(x[:150], train, c='blue')
plt.plot(x[150:], forecasts, c='green')
plt.show()
```

Two arguments carry the weight. seasonal=True turns on seasonal differencing and seasonal terms, and m=12 states the seasonal period explicitly, one year of monthly observations. Leave m unset and the library will guess, which is a decision you usually do not want to delegate on a monthly business series.

predict takes a step count rather than a new series, so you forecast forward from the training endpoint.

## Pipelines serialize with pickle, and the BoxCox stage is the fiddly one

The second quickstart puts a transformation in front of the model as a named pipeline stage, which is where the scikit-learn heritage shows:

```python
from pmdarima.pipeline import Pipeline
from pmdarima.preprocessing import BoxCoxEndogTransformer

pipeline = Pipeline([
    ('boxcox', BoxCoxEndogTransformer(lmbda2=1e-6)),  # lmbda2 avoids negative values
    ('arima', pm.AutoARIMA(seasonal=True, m=12,
                           suppress_warnings=True,
                           trace=True))
])

pipeline.fit(train)

with open('model.pkl', 'wb') as pkl:
    pickle.dump(pipeline, pkl)

with open('model.pkl', 'rb') as pkl:
    mod = pickle.load(pkl)
    print(mod.predict(15))
```

lmbda2 is the parameter to notice. Box-Cox requires strictly positive values, and lmbda2 is the floor applied to them, so setting it to 1e-6 keeps zeros from crashing the transform. The comment in the example says exactly that.

Because the fitted object is a plain pickle, the usual scikit-learn caveat applies with more force: unpickling runs the package's own module import paths, so a model.pkl produced under one pmdarima version is not guaranteed to load under another. The README does not document a version compatibility policy for serialized models.

## What is in the box beyond auto_arima

The rest of the surface falls into a few groups. Stationarity and seasonality tests are there as standalone utilities, along with differencing and inverse differencing helpers. Seasonal decomposition is included.

The transformer layer is the widest part: endogenous and exogenous transformers and featurizers, with Box-Cox and Fourier transformations named in the README. Fourier terms are how you add deterministic seasonality without a seasonal ARIMA order, which is often the cheaper model when the seasonal pattern is smooth.

Cross-validation utilities sit in pmdarima.model_selection, and the train_test_split used above comes from there. Rolling origin evaluation is the point of that module, since a random split of a time series leaks future information into the fit.

Built-in datasets cover the common cases for prototyping. For anything real, you load your own series, and the interface is the same.

## Where pmdarima is the wrong choice

Data with strong exogenous drivers, structural breaks, or heavy tailed noise will fit an ARIMA poorly no matter which order the search picks, and auto_arima will happily return the least bad candidate.

The library also depends on an assumed seasonal period. m=12 on monthly data is a statement about your domain, not a fitted parameter, and a wrong m produces a model that looks converged and forecasts badly.

There is a dependency weight argument too. Installing pmdarima pulls joblib, numpy, pandas, scikit-learn, scipy, statsmodels and urllib3, on top of numpy and cython at build time. If your forecasting needs are a single damped trend, that is a lot of surface for the job.

## Maintenance, licensing and the 2.0 boundary

The repository is not archived, and the last push was on 2026-10-02. The newest tagged releases are v2.1.1 on 2025-11-17 and v2.1.0 on 2025-11-13, preceded by a v2.1.0rc9 release candidate on the same day as 2.1.0. A release candidate published alongside the final suggests the project ships candidates during stabilization, so you can pin one if you need to test before the final lands.

Licensing is MIT, stated in pyproject.toml and in the LICENSE file, with no separate terms for the bundled datasets mentioned in the README.

The 2.0 boundary is the practical upgrade cost. Legacy installs under the old pyramid-arima name still resolve, and the README says so with a warning that it is not recommended. The real break is elsewhere: Python 3.10 is the floor, and the 32-bit wheel path ends below 2.0.0. A pinned environment on an older interpreter has to move to Python 3.10 and rebuild before it can move to pmdarima 2.x.

## Conclusion

pmdarima is worth adopting if your forecasting work is ARIMA based and you want model selection, transformation and cross-validation to live in one fit and predict interface, particularly if you already think in scikit-learn pipelines. Skip it if your data is short, if seasonal structure is weak, or if you need a method family outside ARIMA, since auto_arima searches ARIMA orders and nothing else. Verify first that your platform has a wheel for pmdarima on Python 3.10 or newer, because a missing wheel means a source build that needs cython>=0.29 plus gcc on macOS and Linux or MinGW on Windows, which is a different day of work than pip install pmdarima.

## FAQ

### How do I install pmdarima on Python?

Use pip install pmdarima, which pulls binary wheels for 64-bit Mac, Linux manylinux and Windows on Python 3.10 and newer. Conda users can add the conda-forge channel and install pmdarima, though the project does not maintain those binaries itself.

### What is the equivalent of R's auto.arima in Python?

pmdarima provides it as pm.auto_arima, which searches ARIMA orders for a series instead of requiring you to choose p, d and q yourself. The README names the R forecast package's auto.arima as the specific gap pmdarima was written to fill.

### Can pmdarima models be saved and loaded?

A fitted pipeline is serialized with pickle, as in the sunspots example that writes model.pkl and loads it back to call predict(15). The README shows no version compatibility policy for serialized models, so unpickling depends on a matching pmdarima version.

### Does pmdarima work with exogenous variables?

pmdarima lists exogenous transformers and featurizers among its features and wraps statsmodels under the hood. The README does not walk through a SARIMAX workflow, so check the documentation for that specific case.

### What are the requirements to build pmdarima from source?

When no wheel matches your platform, you need cython>=0.29 and gcc on Mac and Linux, or MinGW on Windows. The build uses the meson-python backend and requires numpy>=2.0.0 at build time.

## Sources

- [alkaline-ml/pmdarima on GitHub](https://github.com/alkaline-ml/pmdarima)
- [License: MIT](https://github.com/alkaline-ml/pmdarima/blob/master/LICENSE)
- [Project website](https://www.alkaline-ml.com/pmdarima)
- [README](https://github.com/alkaline-ml/pmdarima/blob/master/README.md)
- [Releases](https://github.com/alkaline-ml/pmdarima/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/alkaline-ml-pmdarima
