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

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

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.6+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (32 & 64-bit)

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-1.8.1.tar.gz (1.0 MB view details)

Uploaded Source

Built Distributions

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

pmdarima-1.8.1-cp39-cp39-win_amd64.whl (597.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pmdarima-1.8.1-cp39-cp39-win32.whl (547.7 kB view details)

Uploaded CPython 3.9Windows x86

pmdarima-1.8.1-cp39-cp39-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9

pmdarima-1.8.1-cp39-cp39-macosx_10_15_x86_64.whl (601.6 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

pmdarima-1.8.1-cp38-cp38-win_amd64.whl (597.6 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.8.1-cp38-cp38-win32.whl (547.4 kB view details)

Uploaded CPython 3.8Windows x86

pmdarima-1.8.1-cp38-cp38-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8

pmdarima-1.8.1-cp38-cp38-macosx_10_15_x86_64.whl (594.0 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.8.1-cp37-cp37m-win_amd64.whl (592.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.8.1-cp37-cp37m-win32.whl (542.4 kB view details)

Uploaded CPython 3.7mWindows x86

pmdarima-1.8.1-cp37-cp37m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m

pmdarima-1.8.1-cp37-cp37m-macosx_10_15_x86_64.whl (593.8 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.8.1-cp36-cp36m-win_amd64.whl (591.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.8.1-cp36-cp36m-win32.whl (541.7 kB view details)

Uploaded CPython 3.6mWindows x86

pmdarima-1.8.1-cp36-cp36m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m

pmdarima-1.8.1-cp36-cp36m-macosx_10_15_x86_64.whl (591.7 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.8.1.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for pmdarima-1.8.1.tar.gz
Algorithm Hash digest
SHA256 c0c1f7860ce2f8399c71fc3ead31abc67c7dd9aab8da512b4f31fa919a1999f2
MD5 dd9a603116f51511c166933a09a1487a
BLAKE2b-256 5a4a2f37cf7527264c73f5a1e441f012c779f77aff59f2cd2b604abca767001d

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 597.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6244825c2283e71664f43cbe53cf720ec10d8b173867d421f5f1199ee1288a78
MD5 7fb7af7337f33763a7e7a4fbaeaaaf05
BLAKE2b-256 5ab990b14a32e27be42f8fa8cd21fe4bfccd8a80eae774af576b91df7660f853

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp39-cp39-win32.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp39-cp39-win32.whl
  • Upload date:
  • Size: 547.7 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 a73490e7b24cf0cbbe10a8d9648f2efa5c2e88542419ed6f3535dd29cc549732
MD5 db7946c25d5b0517341c3a6a4fdad17e
BLAKE2b-256 a2961dad09f8a9af9b046cb2c271560dbbd53f6429b255539d7f1e5fb30a87b7

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ba6742c979050c5855961d1cff0d7156c5d96f002487824a11df65ee7c1d3da0
MD5 c28a5f65935af66646184c34a5ad89ce
BLAKE2b-256 7b44106d2587247174647ef337766b40f08e244debebf55915b817982459f605

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 601.6 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 627a46f6cf47c74a52cf84f82753c2246d3e5167eb9b40cc38e610d6beab9a6f
MD5 bf21afd93918632026da8c82cbe2ea11
BLAKE2b-256 113aea9a1ee5008d3501c3db25ddd9d96cc50ff5641851c5f5c374c594043d2c

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 597.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 01ddcca97c8daae5c3c5695f40377e813bd753b50ad87ad6b9a7647606a3f937
MD5 ace6f378406740df30933f52ffddbf2a
BLAKE2b-256 8ce32a2417e41c843153ec28fb902d8151838778cf1b60eb9bb958441fe69b14

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp38-cp38-win32.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 547.4 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 17ea59d5923bdf7094c15c9221875dc06694bfec9476eb56c17065701b0e1b03
MD5 6ecb8499e3d8c91ffb5db0cda80ef775
BLAKE2b-256 e5126677c46d9a9851cd9238bfde69ca3ce2a6b45352aaa44412e688224ded2c

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 db770035fef8356a3b62fbe5762038ef0bdaeb1abba5d4242912176fb946f906
MD5 56a311ce92879a3e2dd9bd77f5aec9d6
BLAKE2b-256 30b5cbfa9cda902d2954a6b6f5a03ee86d8ed14202ef46382ecacb71a722a69b

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 594.0 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 dc8f334135375ab9dd9ec28ef63d2707036f7b09dac724ff2764377127f49355
MD5 8ada3af3462c7cf3569c9b4f4c47599c
BLAKE2b-256 e77d857f21d9ebe932e64183b691c84008b628dc4430a13984752214f964ce7e

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 592.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 45c03cc7d39c74e6d547c4e836775a0661591f0f239b361b9e76d5ab573288a7
MD5 184aa3c766c765543ae08efa0d3b1edb
BLAKE2b-256 cbff7c56e64e0997a327d4d842eb19b7e1656ea52e9e8afced01431d9f9a0b52

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 542.4 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 ad9889810cc6fd5603f39fda160d6e49c9763f0c44dacc3fbbbd958ce5832db7
MD5 6d5afd8547bb07dd5dca04abdd91708f
BLAKE2b-256 f3ea5f397b42f0b8ee116aa15309c9de588e7b2dbfd6818bf9f68693f526092e

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 670901137e5be34df1b021b5a076527c195fd1d7e9e25d4688dd4fff86562673
MD5 acf2aa4eea749de8a4cbde39b5de80b8
BLAKE2b-256 515799ce8a09e6f89fde92c0a27b97dda778f43d30a1cc2ae4e345d61353fcc0

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 593.8 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c97c306a4c9571190a1cd56a00141a8074bfb11eddbe6b6897376af40a2af135
MD5 b9faa8cf51ce4e5fb388cc982b538292
BLAKE2b-256 f58f2eb77a05b1acb3a0038d0b52564645d16b08e3471fa2bbf6a935154d00f3

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 591.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 20e5ce5dcdc2905de19b115ffd41ea8eaccb22873e106f06b21c003634a7935d
MD5 2308cd6df8d8dee9643d838dc6d6a67d
BLAKE2b-256 1f81e32bc00c1cf67d81403245495e12fc86486fa3139343a9014fce324b3d25

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 541.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 07c330b1b71fedff02f119f0eda25079a045281f3b7fd51550c1ff711ea0943d
MD5 023cadf2920f2c8a5370f1ac48925b83
BLAKE2b-256 e125031957d0a0869e3a28c87915855072d00f724a6f2a3158eda8cf71e4919a

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4d20c607a5089e19d45fa8e2b63ad37a274d51a86513efd9f2a506327d1e8fa1
MD5 d981653d3eb421048bac804ba274b3e6
BLAKE2b-256 dda7c4ba99e7bf603628ba8d88df0ccf8c0cd460ed3037314e7dd5270f9bab2d

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.1-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.1-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 591.7 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for pmdarima-1.8.1-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8ac8e77faaab7dd13a102c7d9fb81ee4f43a9c6ddba4b8f6decbe82f715eaa25
MD5 63c21fd77a27fe865f3ac198d8bf79e2
BLAKE2b-256 1d606f342625f906f18157d7478c699b8e3bd4ba8007aaf500c542e39d818f4c

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