Skip to main content

Python's forecast::auto.arima equivalent

Project description

pmdarima

PyPI version CircleCI Github Actions Status codecov Supported versions Downloads Downloads/Week

Pmdarima (originally pyramid-arima, for the anagram of 'py' + 'arima') is a statistical library designed to fill the void in Python's time series analysis capabilities. This includes:

  • The equivalent of R's auto.arima functionality
  • A collection of statistical tests of stationarity and seasonality
  • Time series utilities, such as differencing and inverse differencing
  • Numerous endogenous and exogenous transformers and featurizers, including Box-Cox and Fourier transformations
  • Seasonal time series decompositions
  • Cross-validation utilities
  • A rich collection of built-in time series datasets for prototyping and examples
  • Scikit-learn-esque pipelines to consolidate your estimators and promote productionization

Pmdarima wraps statsmodels under the hood, but is designed with an interface that's familiar to users coming from a scikit-learn background.

Installation

pip

Pmdarima has binary and source distributions for Windows, Mac and Linux (manylinux) on pypi under the package name pmdarima and can be downloaded via pip:

pip install pmdarima

conda

Pmdarima also has Mac and Linux builds available via conda and can be installed like so:

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

Note: We do not maintain our own Conda binaries, they are maintained at https://github.com/conda-forge/pmdarima-feedstock. See that repo for further documentation on working with Pmdarima on Conda.

Quickstart Examples

Fitting a simple auto-ARIMA on the wineind dataset:

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()
Wineind example

Fitting a more complex pipeline on the sunspots dataset, serializing it, and then loading it from disk to make predictions:

import pmdarima as pm
from pmdarima.model_selection import train_test_split
from pmdarima.pipeline import Pipeline
from pmdarima.preprocessing import BoxCoxEndogTransformer
import pickle

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

# Define and fit your pipeline
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)

# Serialize your model just like you would in scikit:
with open('model.pkl', 'wb') as pkl:
    pickle.dump(pipeline, pkl)
    
# Load it and make predictions seamlessly:
with open('model.pkl', 'rb') as pkl:
    mod = pickle.load(pkl)
    print(mod.predict(15))
# [25.20580375 25.05573898 24.4263037  23.56766793 22.67463049 21.82231043
# 21.04061069 20.33693017 19.70906027 19.1509862  18.6555793  18.21577243
# 17.8250318  17.47750614 17.16803394]

Availability

pmdarima is available on PyPi in pre-built Wheel files for Python 3.10+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (64-bit)
    • 32-bit wheels are available for pmdarima versions below 2.0.0 and Python versions below 3.10

If a wheel doesn't exist for your platform, you can still pip install and it will build from the source distribution tarball, however you'll need cython>=0.29 and gcc (Mac/Linux) or MinGW (Windows) in order to build the package from source.

Note that legacy versions (<1.0.0) are available under the name "pyramid-arima" and can be pip installed via:

# Legacy warning:
$ pip install pyramid-arima
# python -c 'import pyramid;'

However, this is not recommended.

Documentation

All of your questions and more (including examples and guides) can be answered by the pmdarima documentation. If not, always feel free to file an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmdarima-2.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pmdarima-2.1.0-cp313-cp313-win_amd64.whl (712.0 kB view details)

Uploaded CPython 3.13Windows x86-64

pmdarima-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (688.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pmdarima-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (670.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

pmdarima-2.1.0-cp313-cp313-macosx_11_0_arm64.whl (591.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pmdarima-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl (602.6 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

pmdarima-2.1.0-cp312-cp312-win_amd64.whl (715.6 kB view details)

Uploaded CPython 3.12Windows x86-64

pmdarima-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (689.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pmdarima-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (670.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

pmdarima-2.1.0-cp312-cp312-macosx_11_0_arm64.whl (593.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pmdarima-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl (604.6 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

pmdarima-2.1.0-cp311-cp311-win_amd64.whl (722.7 kB view details)

Uploaded CPython 3.11Windows x86-64

pmdarima-2.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (698.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pmdarima-2.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (683.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

pmdarima-2.1.0-cp311-cp311-macosx_11_0_arm64.whl (592.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pmdarima-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl (602.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pmdarima-2.1.0-cp310-cp310-win_amd64.whl (719.3 kB view details)

Uploaded CPython 3.10Windows x86-64

pmdarima-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (665.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

pmdarima-2.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (694.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pmdarima-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (593.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pmdarima-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl (604.2 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file pmdarima-2.1.0.tar.gz.

File metadata

  • Download URL: pmdarima-2.1.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pmdarima-2.1.0.tar.gz
Algorithm Hash digest
SHA256 7e648dc6d8d3c2529fcf395f10f2c903b204e6c0013a19acd7783f8ec160f87d
MD5 de0a8556c0874d811d774dc3667d3ed8
BLAKE2b-256 c0247ec4c28432a9b4585b47010df90f563e9180118b219bf9d05f53877e02f3

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pmdarima-2.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 712.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pmdarima-2.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e00db7025d54ff0d501dd5e466c540a766802f07d4e76e75cbc315f92f922d71
MD5 c82120596b65923c92e65154800a2f0d
BLAKE2b-256 a0699494f7ca7497e95671f7aad48cf821d5a65e993c4e100b29cfa3857d4aca

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 afc9f2a0fd71533ffcad2b0dfea4f277a8ba1cdedd94517018403f6609f7aad2
MD5 be4775ac89ff3231d977330825b243b5
BLAKE2b-256 c550829a2556ecf4f53af4c0f1319dd910ff6bdd79c54decbf35d2bcc666a04b

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7ee7a8b00ed0765648612aec0f073d45f32bedc03347b5bb25f7d867b9d73cca
MD5 27d98da17dafaf92250d9351feaed883
BLAKE2b-256 ddf8fe98659a61120604931c79b051e4c4d255a25810b701ec0e6bf3c413bef3

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2fbf42036829d2264ff6e61b8f4a58777e5cf20ddd3ffecf5ef075234c2ab7c8
MD5 18d364f810cef08cd12a75e241cec665
BLAKE2b-256 c61cc95e2ab4188d72a63616f0ab9860e9d67198a58d5e0c6c29f00c9567723b

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 97495b07702ae398d6ec48bc51318f68a7635c211185fb95964e18a39e703dfe
MD5 e2c673ac80998ae7b0fdc89ce0609ef4
BLAKE2b-256 7fbdbc661453df6790b2c145f67d55c697bd5a970b4a9f680f477dd45a1feace

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pmdarima-2.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 715.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pmdarima-2.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed53f6e5b9ad25877297815105020bfdab49ee2b00e3c6cabcbfbeb50a8c4b20
MD5 985b91a88500641f83cbc98b24aee2e8
BLAKE2b-256 6a73c0994383489c97e1413a8c3db23814040fb98e9bec4e791099143eadec61

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc8d372b185445fee4245fceb9add2870234be1ed7f61c6b6ba2f56664019170
MD5 3651bb5aca1a06ec524ddfbf4dc628b2
BLAKE2b-256 50df0f2af313bb0572444c496e67bce284fcf72bd410bf4fe8da7c5d015e7ee4

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0931c9ccd0a58dd4fd918aa9f59e2150357a88b41986959c0001c4eed07d253e
MD5 0d4b1cfebd893f7bd37d08aafe38b3b2
BLAKE2b-256 04a961af7664d54d4fed5d7d76f10e0d05d9604e3bf9ae42e1cb271214a2458f

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7111ea1c9f14886bf23a409dd896a2692e57f2d83d07a1dcb481d47ed2de72d0
MD5 84377ebfc654dfd1df58251a80ef4509
BLAKE2b-256 8d4d66c3b27f26d787db8f02be513ac0c6a8087099faf204d3f505dacc9f55e6

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 cb1d6fb33886c409543c5ab875e627c27f79ed3525c60752b4b67a34ac8bc7d2
MD5 2c098e0df9dd6ddc73200567db77cc11
BLAKE2b-256 cdf4328fe54c3f3dd5e2475d418cbb04514d66f1cb79a8b8c7cacf7e98362699

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pmdarima-2.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 722.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pmdarima-2.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a710fa8d07cc7eb5f469db194700b72f4ef25ca8c1bc761c7776b2a35dcede03
MD5 a839e39025a24016ab5124ee2e8167fe
BLAKE2b-256 dc1c8fa7180f3aee12e1d92285b2e46090e7ec0dfa6f784ef72d8887be9c6cb9

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1ad858afa3f2d3d2867864986ad137c2ab7507780bed29bd7e335aa4250fa5a5
MD5 0dd1a7370b18dabb616e3721b8f9e209
BLAKE2b-256 1b4daf1b91330f0acb1c2c61602fdb3b4fe9a6071c33ebc6b182c9d2e4d8e74a

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bb0c50b508f7e7c1d84db3c3e09d4cebd06b58fc2343ad7c6b282a291f5e02e7
MD5 bd51cdf64bc236ee64715b7ae35a98ab
BLAKE2b-256 4a6a37f80b5db2bf16f332fec67969b1419b6604e6dfa28b08c372c93811225d

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d9927277d92c9f2c462506c544fda0ccf7dd02d1f562bbca25886dfd982b80a
MD5 81ef0673cc10705be779813870eaebed
BLAKE2b-256 75facde07768c47ffa0db2a78c3d7c83c535c440168b791986f475e41fe10d6d

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7aaa2498145e307cefb77c0e73279050c60e7061a50d075ee88c5b8c8523bfbd
MD5 47a535a88256e9021fbf9757c429462c
BLAKE2b-256 13aaffd3fe4bb280e6ab534033cb630043d26ea6e14a18ee62cea5a5d626ac59

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pmdarima-2.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 719.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for pmdarima-2.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9074206248f450099dcb84e39847383a59f4ab61f7c9828e4261d77e4bf6df13
MD5 870efa3ac550e7be0393bbe68b5193ee
BLAKE2b-256 c5da1d610f53466965af1b11c110b96ebaf4292f04381889b72960627c544cf9

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f4fd4d85146db9033cb35caf191ecdcc120fb745b12f9f317b6aafababcc2859
MD5 fe56ab8883fe60156e9258d95e85599f
BLAKE2b-256 67e743b535c4029f40606fe0a4e7463ea509442b9d01bf1cf234b813250b488f

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c600dd256568399dad65819996eddbe38fca4e2f6a25c4717dd3d9aab6b0a1d
MD5 577bbbd8e10f345973c52d2eb03f23fa
BLAKE2b-256 b21e36911ba1d76beaf576f45eb6cb64ad91128ecca76118510c25a6cbcceb7c

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94dc2e4f5cda06d65a7fc9170538df4f34ce777a73283f89241f8cee77ba3379
MD5 8917001d0be178e74f40c6c046225fe9
BLAKE2b-256 476a6002060cc6adc4842a9d4824b00e60539b9d016fd4634b852092ea3dc474

See more details on using hashes here.

File details

Details for the file pmdarima-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff5bd014bb169cb1307c8b2ec4c7a790ca5e217cbc402fd1d85b488e7dc8843b
MD5 ca55c9526d3a53f65c792ff0e3091583
BLAKE2b-256 ae4a884def438c0982b62d90e08eb4602e4e65125dd86ca1dedaa303a8ac3eba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page